summaryrefslogtreecommitdiff
path: root/jvmaccess
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-06-19 17:58:39 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-06-19 17:58:39 +0000
commit2fa0dda638be96fa6a1a7ef7a6220031668557fd (patch)
tree3fbf9cfb0b35e10c991955b2f62c6f20513c5756 /jvmaccess
parent3b7f242fe40178223226ecf22b7a1eb7927fad93 (diff)
INTEGRATION: CWS warnings01 (1.5.10); FILE MERGED
2005/09/23 02:04:49 sb 1.5.10.2: RESYNC: (1.5-1.6); FILE MERGED 2005/09/01 08:24:51 sb 1.5.10.1: #i53898# Made code warning-free.
Diffstat (limited to 'jvmaccess')
-rw-r--r--jvmaccess/source/virtualmachine.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/jvmaccess/source/virtualmachine.cxx b/jvmaccess/source/virtualmachine.cxx
index 63ed5f442..be3335ff5 100644
--- a/jvmaccess/source/virtualmachine.cxx
+++ b/jvmaccess/source/virtualmachine.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: virtualmachine.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: rt $ $Date: 2005-09-07 19:23:17 $
+ * last change: $Author: hr $ $Date: 2006-06-19 18:58:39 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -150,7 +150,9 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const
OSL_ENSURE(pAttached != 0, "bad parameter");
JNIEnv * pEnv;
jint n = m_pVm->GetEnv(reinterpret_cast< void ** >(&pEnv), m_nVersion);
- OSL_ENSURE(n == JNI_OK || n == JNI_EDETACHED, "JNI: GetEnv failed");
+ if (n != JNI_OK && n != JNI_EDETACHED) {
+ OSL_ENSURE(false, "JNI: GetEnv failed");
+ }
if (pEnv == 0)
{
if (m_pVm->AttachCurrentThread(reinterpret_cast< void ** >(&pEnv), 0)
@@ -180,7 +182,8 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const
void VirtualMachine::detachThread() const
{
#ifdef SOLAR_JAVA
- jint n = m_pVm->DetachCurrentThread();
- OSL_ENSURE(n == JNI_OK, "JNI: DetachCurrentThread failed");
+ if (m_pVm->DetachCurrentThread() != JNI_OK) {
+ OSL_ENSURE(false, "JNI: DetachCurrentThread failed");
+ }
#endif
}