diff options
Diffstat (limited to 'connectivity/source/drivers/jdbc/ContextClassLoader.cxx')
-rw-r--r-- | connectivity/source/drivers/jdbc/ContextClassLoader.cxx | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx b/connectivity/source/drivers/jdbc/ContextClassLoader.cxx index 50e6bc632bc2..3ab1b88eb33b 100644 --- a/connectivity/source/drivers/jdbc/ContextClassLoader.cxx +++ b/connectivity/source/drivers/jdbc/ContextClassLoader.cxx @@ -43,33 +43,33 @@ namespace connectivity::jdbc do // artificial loop for easier flow control { - LocalRef< jclass > threadClass( m_environment ); - threadClass.set( m_environment.FindClass( "java/lang/Thread" ) ); - if ( !threadClass.is() ) - break; - - jmethodID currentThreadMethod( m_environment.GetStaticMethodID( - threadClass.get(), "currentThread", "()Ljava/lang/Thread;" ) ); - if ( currentThreadMethod == nullptr ) - break; - - m_currentThread.set( m_environment.CallStaticObjectMethod( threadClass.get(), currentThreadMethod ) ); - if ( !m_currentThread.is() ) - break; - - jmethodID getContextClassLoaderMethod( m_environment.GetMethodID( - threadClass.get(), "getContextClassLoader", "()Ljava/lang/ClassLoader;" ) ); - if ( getContextClassLoaderMethod == nullptr ) - break; - m_oldContextClassLoader.set( m_environment.CallObjectMethod( m_currentThread.get(), getContextClassLoaderMethod ) ); - LocalRef< jthrowable > throwable( m_environment, m_environment.ExceptionOccurred() ); - if ( throwable.is() ) - break; - - m_setContextClassLoaderMethod = m_environment.GetMethodID( - threadClass.get(), "setContextClassLoader", "(Ljava/lang/ClassLoader;)V" ); - if ( m_setContextClassLoaderMethod == nullptr ) - break; + LocalRef< jclass > threadClass( m_environment ); + threadClass.set( m_environment.FindClass( "java/lang/Thread" ) ); + if ( !threadClass.is() ) + break; + + jmethodID currentThreadMethod( m_environment.GetStaticMethodID( + threadClass.get(), "currentThread", "()Ljava/lang/Thread;" ) ); + if ( currentThreadMethod == nullptr ) + break; + + m_currentThread.set( m_environment.CallStaticObjectMethod( threadClass.get(), currentThreadMethod ) ); + if ( !m_currentThread.is() ) + break; + + jmethodID getContextClassLoaderMethod( m_environment.GetMethodID( + threadClass.get(), "getContextClassLoader", "()Ljava/lang/ClassLoader;" ) ); + if ( getContextClassLoaderMethod == nullptr ) + break; + m_oldContextClassLoader.set( m_environment.CallObjectMethod( m_currentThread.get(), getContextClassLoaderMethod ) ); + LocalRef< jthrowable > throwable( m_environment, m_environment.ExceptionOccurred() ); + if ( throwable.is() ) + break; + + m_setContextClassLoaderMethod = m_environment.GetMethodID( + threadClass.get(), "setContextClassLoader", "(Ljava/lang/ClassLoader;)V" ); + if ( m_setContextClassLoaderMethod == nullptr ) + break; } while ( false ); |