diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-13 10:09:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-14 09:16:38 +0100 |
commit | ada3817a3334a1e8694f54bb813eee7ffb8b36d7 (patch) | |
tree | e8720013d71eb6ec79e2cac9b975690f1fc716ff /connectivity/source | |
parent | c60eac8db02fa6bd9097dfd387251bf85d9a7616 (diff) |
coverity#706326 Uncaught exception
Change-Id: I922ce18051eefb4507cc84870ce18ae0a49f4608
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/drivers/jdbc/InputStream.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/JConnection.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/JStatement.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/Object.cxx | 15 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/PreparedStatement.cxx | 30 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/Reader.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/ResultSet.cxx | 47 | ||||
-rw-r--r-- | connectivity/source/drivers/jdbc/Throwable.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/inc/java/lang/Object.hxx | 5 |
9 files changed, 65 insertions, 54 deletions
diff --git a/connectivity/source/drivers/jdbc/InputStream.cxx b/connectivity/source/drivers/jdbc/InputStream.cxx index 16341a180c28..5990be47ab54 100644 --- a/connectivity/source/drivers/jdbc/InputStream.cxx +++ b/connectivity/source/drivers/jdbc/InputStream.cxx @@ -73,7 +73,7 @@ sal_Int32 SAL_CALL java_io_InputStream::available( ) throw(::com::sun::star::io void SAL_CALL java_io_InputStream::closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("close",mID); + callVoidMethod_Throw("close",mID); } sal_Int32 SAL_CALL java_io_InputStream::readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index d9a388190525..7fe3fe8b59c2 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -309,7 +309,7 @@ void java_sql_Connection::disposing() if ( object ) { static jmethodID mID(NULL); - callVoidMethod("close",mID); + callVoidMethod_Throw("close", mID); } } @@ -361,7 +361,7 @@ void SAL_CALL java_sql_Connection::close( ) throw(SQLException, RuntimeExceptio void SAL_CALL java_sql_Connection::commit( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("commit",mID); + callVoidMethod_Throw("commit", mID); } sal_Bool SAL_CALL java_sql_Connection::isClosed( ) throw(SQLException, RuntimeException, std::exception) @@ -389,7 +389,7 @@ void SAL_CALL java_sql_Connection::setCatalog( const OUString& catalog ) throw(S void SAL_CALL java_sql_Connection::rollback( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("rollback",mID); + callVoidMethod_Throw("rollback", mID); } sal_Bool SAL_CALL java_sql_Connection::getAutoCommit( ) throw(SQLException, RuntimeException, std::exception) @@ -557,7 +557,7 @@ OUString SAL_CALL java_sql_Connection::nativeSQL( const OUString& sql ) throw(SQ void SAL_CALL java_sql_Connection::clearWarnings( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("clearWarnings",mID); + callVoidMethod_Throw("clearWarnings", mID); } Any SAL_CALL java_sql_Connection::getWarnings( ) throw(SQLException, RuntimeException, std::exception) diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx index 16d6631d6d2b..dd753399cd18 100644 --- a/connectivity/source/drivers/jdbc/JStatement.cxx +++ b/connectivity/source/drivers/jdbc/JStatement.cxx @@ -85,7 +85,7 @@ void SAL_CALL OStatement_BASE2::disposing() if ( object ) { static jmethodID mID(NULL); - callVoidMethod("close",mID); + callVoidMethod_Throw("close", mID); } ::comphelper::disposeComponent(m_xGeneratedStatement); @@ -192,7 +192,7 @@ void SAL_CALL java_sql_Statement_Base::cancel( ) throw(RuntimeException, std::e SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("cancel",mID); + callVoidMethod_Nothrow("cancel",mID); } @@ -214,7 +214,7 @@ void SAL_CALL java_sql_Statement::clearBatch( ) throw(::com::sun::star::sdbc::S createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("clearBatch",mID); + callVoidMethod_Throw("clearBatch", mID); } //t.pEnv } @@ -409,7 +409,7 @@ void SAL_CALL java_sql_Statement_Base::clearWarnings( ) throw(::com::sun::star: { createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("clearWarnings",mID); + callVoidMethod_Throw("clearWarnings", mID); } } diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 37538fa77d87..37c8a410e907 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -296,7 +296,7 @@ sal_Int32 java_lang_Object::callIntMethodWithIntArg( const char* _pMethodName, j return (sal_Int32)out; } -void java_lang_Object::callVoidMethod( const char* _pMethodName, jmethodID& _inout_MethodID) const +void java_lang_Object::callVoidMethod_Throw( const char* _pMethodName, jmethodID& _inout_MethodID) const { SDBThreadAttach t; OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java environment anymore!" ); @@ -307,6 +307,17 @@ void java_lang_Object::callVoidMethod( const char* _pMethodName, jmethodID& _ino ThrowSQLException( t.pEnv, NULL ); } +void java_lang_Object::callVoidMethod_Nothrow( const char* _pMethodName, jmethodID& _inout_MethodID) const +{ + SDBThreadAttach t; + OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java environment anymore!" ); + obtainMethodId(t.pEnv, _pMethodName,"()V", _inout_MethodID); + + // call method + t.pEnv->CallVoidMethod( object, _inout_MethodID ); + isExceptionOccurred(t.pEnv, true); +} + void java_lang_Object::callVoidMethodWithIntArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const { SDBThreadAttach t; @@ -326,7 +337,7 @@ void java_lang_Object::callVoidMethodWithIntArg_Nothrow( const char* _pMethodNam // call method t.pEnv->CallVoidMethod( object, _inout_MethodID,_nArgument ); - isExceptionOccurred(t.pEnv,true); + isExceptionOccurred(t.pEnv, true); } void java_lang_Object::callVoidMethodWithBoolArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument ) const diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx index 7309a20872ac..6e9b33041f1f 100644 --- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx +++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx @@ -169,7 +169,7 @@ void SAL_CALL java_sql_PreparedStatement::setBoolean( sal_Int32 parameterIndex, SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("setBoolean", "(IZ)V", mID, parameterIndex, x); + callVoidMethod_Throw("setBoolean", "(IZ)V", mID, parameterIndex, x); } @@ -182,7 +182,7 @@ void SAL_CALL java_sql_PreparedStatement::setByte( sal_Int32 parameterIndex, sal SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("setByte", "(IB)V", mID, parameterIndex, x); + callVoidMethod_Throw("setByte", "(IB)V", mID, parameterIndex, x); } @@ -196,7 +196,7 @@ void SAL_CALL java_sql_PreparedStatement::setDate( sal_Int32 parameterIndex, con createStatement(t.pEnv); java_sql_Date aT(x); static jmethodID mID(NULL); - callVoidMethod("setDate", "(ILjava/sql/Date;)V", mID, parameterIndex, aT.getJavaObject()); + callVoidMethod_Throw("setDate", "(ILjava/sql/Date;)V", mID, parameterIndex, aT.getJavaObject()); } @@ -211,7 +211,7 @@ void SAL_CALL java_sql_PreparedStatement::setTime( sal_Int32 parameterIndex, con createStatement(t.pEnv); java_sql_Time aT(x); static jmethodID mID(NULL); - callVoidMethod("setTime", "(ILjava/sql/Time;)V", mID, parameterIndex, aT.getJavaObject()); + callVoidMethod_Throw("setTime", "(ILjava/sql/Time;)V", mID, parameterIndex, aT.getJavaObject()); } @@ -225,7 +225,7 @@ void SAL_CALL java_sql_PreparedStatement::setTimestamp( sal_Int32 parameterIndex createStatement(t.pEnv); static jmethodID mID(NULL); java_sql_Timestamp aD(x); - callVoidMethod("setTimestamp", "(ILjava/sql/Timestamp;)V", mID, parameterIndex, aD.getJavaObject()); + callVoidMethod_Throw("setTimestamp", "(ILjava/sql/Timestamp;)V", mID, parameterIndex, aD.getJavaObject()); } void SAL_CALL java_sql_PreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) @@ -237,7 +237,7 @@ void SAL_CALL java_sql_PreparedStatement::setDouble( sal_Int32 parameterIndex, d SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("setDouble", "(ID)V", mID, parameterIndex, x); + callVoidMethod_Throw("setDouble", "(ID)V", mID, parameterIndex, x); } @@ -250,7 +250,7 @@ void SAL_CALL java_sql_PreparedStatement::setFloat( sal_Int32 parameterIndex, fl SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("setFloat", "(IF)V", mID, parameterIndex, x); + callVoidMethod_Throw("setFloat", "(IF)V", mID, parameterIndex, x); } @@ -263,7 +263,7 @@ void SAL_CALL java_sql_PreparedStatement::setInt( sal_Int32 parameterIndex, sal_ SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("setInt", "(II)V", mID, parameterIndex, x); + callVoidMethod_Throw("setInt", "(II)V", mID, parameterIndex, x); } @@ -276,7 +276,7 @@ void SAL_CALL java_sql_PreparedStatement::setLong( sal_Int32 parameterIndex, sal SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("setLong", "(IJ)V", mID, parameterIndex, x); + callVoidMethod_Throw("setLong", "(IJ)V", mID, parameterIndex, x); } @@ -289,7 +289,7 @@ void SAL_CALL java_sql_PreparedStatement::setNull( sal_Int32 parameterIndex, sal SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("setNull", "(II)V", mID, parameterIndex, sqlType); + callVoidMethod_Throw("setNull", "(II)V", mID, parameterIndex, sqlType); } @@ -385,7 +385,7 @@ void SAL_CALL java_sql_PreparedStatement::setObjectNull( sal_Int32 parameterInde SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod<jobject>("setObject", "(ILjava/lang/Object;)V", mID, parameterIndex, NULL); + callVoidMethod_Throw<jobject>("setObject", "(ILjava/lang/Object;)V", mID, parameterIndex, NULL); } @@ -411,7 +411,7 @@ void SAL_CALL java_sql_PreparedStatement::setShort( sal_Int32 parameterIndex, sa SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("setShort", "(IS)V", mID, parameterIndex, x); + callVoidMethod_Throw("setShort", "(IS)V", mID, parameterIndex, x); } @@ -549,7 +549,7 @@ void SAL_CALL java_sql_PreparedStatement::clearParameters( ) throw(::com::sun:: createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("clearParameters",mID); + callVoidMethod_Throw("clearParameters",mID); } //t.pEnv } @@ -561,7 +561,7 @@ void SAL_CALL java_sql_PreparedStatement::clearBatch( ) throw(::com::sun::star: { createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("clearBatch",mID); + callVoidMethod_Throw("clearBatch",mID); } //t.pEnv } @@ -574,7 +574,7 @@ void SAL_CALL java_sql_PreparedStatement::addBatch( ) throw(::com::sun::star::sd { createStatement(t.pEnv); static jmethodID mID(NULL); - callVoidMethod("addBatch",mID); + callVoidMethod_Throw("addBatch", mID); } //t.pEnv } diff --git a/connectivity/source/drivers/jdbc/Reader.cxx b/connectivity/source/drivers/jdbc/Reader.cxx index 3d07a72f25e3..b88e3b9dbabe 100644 --- a/connectivity/source/drivers/jdbc/Reader.cxx +++ b/connectivity/source/drivers/jdbc/Reader.cxx @@ -75,7 +75,7 @@ sal_Int32 SAL_CALL java_io_Reader::available( ) throw(::com::sun::star::io::Not void SAL_CALL java_io_Reader::closeInput( ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("close",mID); + callVoidMethod_Throw("close", mID); } sal_Int32 SAL_CALL java_io_Reader::readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) diff --git a/connectivity/source/drivers/jdbc/ResultSet.cxx b/connectivity/source/drivers/jdbc/ResultSet.cxx index 881fc463d3e0..6ab7327c0aed 100644 --- a/connectivity/source/drivers/jdbc/ResultSet.cxx +++ b/connectivity/source/drivers/jdbc/ResultSet.cxx @@ -96,8 +96,7 @@ jclass java_sql_ResultSet::getMyClass() const return theClass; } - -void java_sql_ResultSet::disposing(void) +void java_sql_ResultSet::disposing() { OPropertySetHelper::disposing(); @@ -107,7 +106,7 @@ m_xMetaData.clear(); { SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); static jmethodID mID(NULL); - callVoidMethod("close",mID); + callVoidMethod_Throw("close", mID); clearObject(*t.pEnv); } @@ -407,13 +406,13 @@ sal_Bool SAL_CALL java_sql_ResultSet::isLast( ) throw(SQLException, RuntimeExce void SAL_CALL java_sql_ResultSet::beforeFirst( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("beforeFirst",mID); + callVoidMethod_Throw("beforeFirst", mID); } void SAL_CALL java_sql_ResultSet::afterLast( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("afterLast",mID); + callVoidMethod_Throw("afterLast", mID); } @@ -503,14 +502,14 @@ sal_Bool SAL_CALL java_sql_ResultSet::wasNull( ) throw(SQLException, RuntimeExc void SAL_CALL java_sql_ResultSet::cancel( ) throw(::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("cancel",mID); + callVoidMethod_Throw("cancel", mID); } void SAL_CALL java_sql_ResultSet::clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("clearWarnings",mID); + callVoidMethod_Throw("clearWarnings", mID); } ::com::sun::star::uno::Any SAL_CALL java_sql_ResultSet::getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) @@ -534,40 +533,40 @@ void SAL_CALL java_sql_ResultSet::clearWarnings( ) throw(::com::sun::star::sdbc void SAL_CALL java_sql_ResultSet::insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("insertRow",mID); + callVoidMethod_Throw("insertRow", mID); } void SAL_CALL java_sql_ResultSet::updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("updateRow",mID); + callVoidMethod_Throw("updateRow", mID); } void SAL_CALL java_sql_ResultSet::deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("deleteRow",mID); + callVoidMethod_Throw("deleteRow", mID); } void SAL_CALL java_sql_ResultSet::cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("cancelRowUpdates",mID); + callVoidMethod_Throw("cancelRowUpdates", mID); } void SAL_CALL java_sql_ResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("moveToInsertRow",mID); + callVoidMethod_Throw("moveToInsertRow", mID); } void SAL_CALL java_sql_ResultSet::moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("moveToCurrentRow",mID); + callVoidMethod_Throw("moveToCurrentRow", mID); } @@ -581,32 +580,32 @@ void SAL_CALL java_sql_ResultSet::updateNull( sal_Int32 columnIndex ) throw(::co void SAL_CALL java_sql_ResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("updateBoolean", "(IZ)V", mID, columnIndex, x); + callVoidMethod_Throw("updateBoolean", "(IZ)V", mID, columnIndex, x); } void SAL_CALL java_sql_ResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("updateByte", "(IB)V", mID, columnIndex, x); + callVoidMethod_Throw("updateByte", "(IB)V", mID, columnIndex, x); } void SAL_CALL java_sql_ResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("updateShort", "(IS)V", mID, columnIndex, x); + callVoidMethod_Throw("updateShort", "(IS)V", mID, columnIndex, x); } void SAL_CALL java_sql_ResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("updateInt", "(II)V", mID, columnIndex, x); + callVoidMethod_Throw("updateInt", "(II)V", mID, columnIndex, x); } void SAL_CALL java_sql_ResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("updateLong", "(IJ)V", mID, columnIndex, x); + callVoidMethod_Throw("updateLong", "(IJ)V", mID, columnIndex, x); } @@ -614,14 +613,14 @@ void SAL_CALL java_sql_ResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x void SAL_CALL java_sql_ResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("updateFloat", "(IF)V", mID, columnIndex, x); + callVoidMethod_Throw("updateFloat", "(IF)V", mID, columnIndex, x); } void SAL_CALL java_sql_ResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("updateDouble", "(ID)V", mID, columnIndex, x); + callVoidMethod_Throw("updateDouble", "(ID)V", mID, columnIndex, x); } @@ -683,7 +682,7 @@ void SAL_CALL java_sql_ResultSet::updateDate( sal_Int32 columnIndex, const ::com { java_sql_Date aD(x); static jmethodID mID(NULL); - callVoidMethod("updateDate", "(ILjava/sql/Date;)V", mID, columnIndex, aD.getJavaObject()); + callVoidMethod_Throw("updateDate", "(ILjava/sql/Date;)V", mID, columnIndex, aD.getJavaObject()); } @@ -691,7 +690,7 @@ void SAL_CALL java_sql_ResultSet::updateTime( sal_Int32 columnIndex, const ::com { java_sql_Time aD(x); static jmethodID mID(NULL); - callVoidMethod("updateTime", "(ILjava/sql/Time;)V", mID, columnIndex, aD.getJavaObject()); + callVoidMethod_Throw("updateTime", "(ILjava/sql/Time;)V", mID, columnIndex, aD.getJavaObject()); } @@ -699,7 +698,7 @@ void SAL_CALL java_sql_ResultSet::updateTimestamp( sal_Int32 columnIndex, const { java_sql_Timestamp aD(x); static jmethodID mID(NULL); - callVoidMethod("updateTimestamp", "(ILjava/sql/Timestamp;)V", mID, columnIndex, aD.getJavaObject()); + callVoidMethod_Throw("updateTimestamp", "(ILjava/sql/Timestamp;)V", mID, columnIndex, aD.getJavaObject()); } @@ -861,7 +860,7 @@ void java_sql_ResultSet::setFetchDirection(sal_Int32 _par0) throw(::com::sun::st void SAL_CALL java_sql_ResultSet::refreshRow( ) throw(SQLException, RuntimeException, std::exception) { static jmethodID mID(NULL); - callVoidMethod("refreshRow",mID); + callVoidMethod_Throw("refreshRow",mID); } void java_sql_ResultSet::setFetchSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) diff --git a/connectivity/source/drivers/jdbc/Throwable.cxx b/connectivity/source/drivers/jdbc/Throwable.cxx index fa3395ac9d3f..18d7a2bce369 100644 --- a/connectivity/source/drivers/jdbc/Throwable.cxx +++ b/connectivity/source/drivers/jdbc/Throwable.cxx @@ -59,7 +59,7 @@ OUString java_lang_Throwable::getLocalizedMessage() const void java_lang_Throwable::printStackTrace() const { static jmethodID mID(NULL); - return callVoidMethod("printStackTrace",mID); + return callVoidMethod_Throw("printStackTrace",mID); } #endif diff --git a/connectivity/source/inc/java/lang/Object.hxx b/connectivity/source/inc/java/lang/Object.hxx index ed839c78fcf3..cf46e5853d47 100644 --- a/connectivity/source/inc/java/lang/Object.hxx +++ b/connectivity/source/inc/java/lang/Object.hxx @@ -120,7 +120,8 @@ namespace connectivity sal_Int32 callIntMethodWithStringArg( const char* _pMethodName, jmethodID& _inout_MethodID,const OUString& _nArgument ) const; OUString callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const; OUString callStringMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID , sal_Int32 _nArgument) const; - void callVoidMethod( const char* _pMethodName, jmethodID& _inout_MethodID) const; + void callVoidMethod_Throw( const char* _pMethodName, jmethodID& _inout_MethodID) const; + void callVoidMethod_Nothrow( const char* _pMethodName, jmethodID& _inout_MethodID) const; void callVoidMethodWithIntArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const; void callVoidMethodWithIntArg_Nothrow( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const; void callVoidMethodWithBoolArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument ) const; @@ -140,7 +141,7 @@ namespace connectivity } template< typename T > - void callVoidMethod(const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID,sal_Int32 _nArgument, const T& _aValue) const + void callVoidMethod_Throw(const char* _pMethodName, const char* _pSignature, jmethodID& _inout_MethodID,sal_Int32 _nArgument, const T& _aValue) const { SDBThreadAttach t; obtainMethodId(t.pEnv, _pMethodName,_pSignature, _inout_MethodID); |