summaryrefslogtreecommitdiff
path: root/jvmaccess/source
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
commite8c5f89fc563cf49d9c38cb42d670918eeabaad2 (patch)
treeb27487cb453ce2af7f6727d2921d23cd2253da43 /jvmaccess/source
parentd2751711224308279842e438ab02d6f33d4ab1df (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/source')
-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 3726749e92c8..ee66b36e3540 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
}