diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-23 10:35:55 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-23 10:35:55 +0000 |
commit | 390d133a4801651977a14a88a96bf4e850644bb2 (patch) | |
tree | 0a1a8cc6ebfe8b29d61f98e12472dbacd51c685d /connectivity/source/commontools | |
parent | 95879ed9f306fc571d9a1667895e449e24a61425 (diff) |
INTEGRATION: CWS dba201b (1.18.58); FILE MERGED
2005/09/21 06:50:33 oj 1.18.58.2: RESYNC: (1.18-1.19); FILE MERGED
2005/07/06 11:03:05 oj 1.18.58.1: #i49690# check if jvm is null
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r-- | connectivity/source/commontools/CommonTools.cxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx index ff89602047e9..8804260dcb1d 100644 --- a/connectivity/source/commontools/CommonTools.cxx +++ b/connectivity/source/commontools/CommonTools.cxx @@ -4,9 +4,9 @@ * * $RCSfile: CommonTools.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: rt $ $Date: 2005-09-08 05:08:16 $ + * last change: $Author: hr $ $Date: 2005-09-23 11:35:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -305,15 +305,18 @@ namespace connectivity { sal_Bool bRet = sal_False; #ifdef SOLAR_JAVA - jvmaccess::VirtualMachine::AttachGuard aGuard(_pJVM); - JNIEnv* pEnv = aGuard.getEnvironment(); - if( pEnv ) + if ( _pJVM.is() ) { - ::rtl::OString sClassName = ::rtl::OUStringToOString(_sClassName, RTL_TEXTENCODING_ASCII_US); - sClassName = sClassName.replace('.','/'); - jobject out = pEnv->FindClass(sClassName); - bRet = out != NULL; - pEnv->DeleteLocalRef( out ); + jvmaccess::VirtualMachine::AttachGuard aGuard(_pJVM); + JNIEnv* pEnv = aGuard.getEnvironment(); + if( pEnv ) + { + ::rtl::OString sClassName = ::rtl::OUStringToOString(_sClassName, RTL_TEXTENCODING_ASCII_US); + sClassName = sClassName.replace('.','/'); + jobject out = pEnv->FindClass(sClassName); + bRet = out != NULL; + pEnv->DeleteLocalRef( out ); + } } #endif return bRet; |