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.
This commit is contained in:
Jens-Heiner Rechtien
2006-06-19 17:58:39 +00:00
parent d275171122
commit e8c5f89fc5

View File

@@ -4,9 +4,9 @@
* *
* $RCSfile: virtualmachine.cxx,v $ * $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 Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * 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"); OSL_ENSURE(pAttached != 0, "bad parameter");
JNIEnv * pEnv; JNIEnv * pEnv;
jint n = m_pVm->GetEnv(reinterpret_cast< void ** >(&pEnv), m_nVersion); 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 (pEnv == 0)
{ {
if (m_pVm->AttachCurrentThread(reinterpret_cast< void ** >(&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 void VirtualMachine::detachThread() const
{ {
#ifdef SOLAR_JAVA #ifdef SOLAR_JAVA
jint n = m_pVm->DetachCurrentThread(); if (m_pVm->DetachCurrentThread() != JNI_OK) {
OSL_ENSURE(n == JNI_OK, "JNI: DetachCurrentThread failed"); OSL_ENSURE(false, "JNI: DetachCurrentThread failed");
}
#endif #endif
} }