From 2227ed897cb839a501316fc795210ebaa337d60c Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Tue, 20 Jun 2006 00:34:52 +0000 Subject: INTEGRATION: CWS warnings01 (1.20.30); FILE MERGED 2005/12/22 11:44:51 fs 1.20.30.3: #i57457# warning-free code 2005/11/21 10:07:48 fs 1.20.30.2: #i57457# warning-free code on unx* 2005/11/07 14:43:42 fs 1.20.30.1: #i57457# warning-free code --- connectivity/source/drivers/jdbc/Object.cxx | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'connectivity/source/drivers/jdbc/Object.cxx') diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 589b2c486a..44e9701637 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -4,9 +4,9 @@ * * $RCSfile: Object.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: rt $ $Date: 2005-09-08 06:11:09 $ + * last change: $Author: hr $ $Date: 2006-06-20 01:34:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -80,12 +80,12 @@ using namespace ::com::sun::star::lang; } // ----------------------------------------------------------------------------- ::rtl::Reference< jvmaccess::VirtualMachine > java_lang_Object::getVM(const Reference& _rxFactory) -{ +{ ::rtl::Reference< jvmaccess::VirtualMachine > xVM = getJavaVM2(); if ( !xVM.is() && _rxFactory.is() ) xVM = getJavaVM2(::connectivity::getJavaVM(_rxFactory)); - return xVM; + return xVM; } // ----------------------------------------------------------------------------- SDBThreadAttach::SDBThreadAttach() @@ -138,7 +138,7 @@ jclass java_lang_Object::getMyClass() } // der eigentliche Konstruktor java_lang_Object::java_lang_Object(const Reference& _rxFactory) - : object( 0 ),m_xFactory(_rxFactory) + : m_xFactory(_rxFactory),object( 0 ) { SDBThreadAttach::addRef(); } @@ -198,8 +198,8 @@ java_lang_Class * java_lang_Object::getClass() if( t.pEnv ) { // temporaere Variable initialisieren - static char * cSignature = "()Ljava/lang/Class;"; - static char * cMethodName = "getClass"; + static const char * cSignature = "()Ljava/lang/Class;"; + static const char * cMethodName = "getClass"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) @@ -207,23 +207,23 @@ java_lang_Class * java_lang_Object::getClass() if( mID ) { out = t.pEnv->CallObjectMethodA( object, mID, NULL ); - ThrowSQLException(t.pEnv,NULL); + ThrowSQLException(t.pEnv,NULL); return new java_lang_Class( t.pEnv, out ); } //mID } //pEnv return NULL; } -::rtl::OUString java_lang_Object::toString() +::rtl::OUString java_lang_Object::toString() const { - + SDBThreadAttach t; ::rtl::OUString aStr; if( t.pEnv ) { // temporaere Variable initialisieren - static char * cSignature = "()Ljava/lang/String;"; - static char * cMethodName = "toString"; + static const char * cSignature = "()Ljava/lang/String;"; + static const char * cMethodName = "toString"; // Java-Call absetzen static jmethodID mID = NULL; if ( !mID ) @@ -231,7 +231,7 @@ java_lang_Class * java_lang_Object::getClass() if( mID ) { jstring out = (jstring)t.pEnv->CallObjectMethod( object, mID); - ThrowSQLException(t.pEnv,NULL); + ThrowSQLException(t.pEnv,NULL); aStr = JavaString2String(t.pEnv,out); } //mID } //pEnv @@ -240,8 +240,8 @@ java_lang_Class * java_lang_Object::getClass() // -------------------------------------------------------------------------------- void java_lang_Object::ThrowSQLException(JNIEnv * pEnv,const Reference< XInterface> & _rContext) throw(SQLException, RuntimeException) { - jthrowable jThrow = NULL; - if(pEnv && (jThrow = pEnv->ExceptionOccurred())) + jthrowable jThrow = pEnv ? pEnv->ExceptionOccurred() : NULL; + if ( jThrow ) { pEnv->ExceptionClear();// we have to clear the exception here because we want to handle it itself if(pEnv->IsInstanceOf(jThrow,java_sql_SQLException_BASE::getMyClass())) -- cgit v1.2.3