Kaydet (Commit) ada3817a authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#706326 Uncaught exception

Change-Id: I922ce18051eefb4507cc84870ce18ae0a49f4608
üst c60eac8d
...@@ -73,7 +73,7 @@ sal_Int32 SAL_CALL java_io_InputStream::available( ) throw(::com::sun::star::io ...@@ -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) 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); 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) 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)
......
...@@ -309,7 +309,7 @@ void java_sql_Connection::disposing() ...@@ -309,7 +309,7 @@ void java_sql_Connection::disposing()
if ( object ) if ( object )
{ {
static jmethodID mID(NULL); 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 ...@@ -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) void SAL_CALL java_sql_Connection::commit( ) throw(SQLException, RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("commit",mID); callVoidMethod_Throw("commit", mID);
} }
sal_Bool SAL_CALL java_sql_Connection::isClosed( ) throw(SQLException, RuntimeException, std::exception) 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 ...@@ -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) void SAL_CALL java_sql_Connection::rollback( ) throw(SQLException, RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("rollback",mID); callVoidMethod_Throw("rollback", mID);
} }
sal_Bool SAL_CALL java_sql_Connection::getAutoCommit( ) throw(SQLException, RuntimeException, std::exception) 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 ...@@ -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) void SAL_CALL java_sql_Connection::clearWarnings( ) throw(SQLException, RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("clearWarnings",mID); callVoidMethod_Throw("clearWarnings", mID);
} }
Any SAL_CALL java_sql_Connection::getWarnings( ) throw(SQLException, RuntimeException, std::exception) Any SAL_CALL java_sql_Connection::getWarnings( ) throw(SQLException, RuntimeException, std::exception)
......
...@@ -85,7 +85,7 @@ void SAL_CALL OStatement_BASE2::disposing() ...@@ -85,7 +85,7 @@ void SAL_CALL OStatement_BASE2::disposing()
if ( object ) if ( object )
{ {
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("close",mID); callVoidMethod_Throw("close", mID);
} }
::comphelper::disposeComponent(m_xGeneratedStatement); ::comphelper::disposeComponent(m_xGeneratedStatement);
...@@ -192,7 +192,7 @@ void SAL_CALL java_sql_Statement_Base::cancel( ) throw(RuntimeException, std::e ...@@ -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!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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 ...@@ -214,7 +214,7 @@ void SAL_CALL java_sql_Statement::clearBatch( ) throw(::com::sun::star::sdbc::S
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("clearBatch",mID); callVoidMethod_Throw("clearBatch", mID);
} //t.pEnv } //t.pEnv
} }
...@@ -409,7 +409,7 @@ void SAL_CALL java_sql_Statement_Base::clearWarnings( ) throw(::com::sun::star: ...@@ -409,7 +409,7 @@ void SAL_CALL java_sql_Statement_Base::clearWarnings( ) throw(::com::sun::star:
{ {
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("clearWarnings",mID); callVoidMethod_Throw("clearWarnings", mID);
} }
} }
......
...@@ -296,7 +296,7 @@ sal_Int32 java_lang_Object::callIntMethodWithIntArg( const char* _pMethodName, j ...@@ -296,7 +296,7 @@ sal_Int32 java_lang_Object::callIntMethodWithIntArg( const char* _pMethodName, j
return (sal_Int32)out; 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; SDBThreadAttach t;
OSL_ENSURE( t.pEnv, "java_lang_Object::callIntMethod: no Java environment anymore!" ); 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 ...@@ -307,6 +307,17 @@ void java_lang_Object::callVoidMethod( const char* _pMethodName, jmethodID& _ino
ThrowSQLException( t.pEnv, NULL ); 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 void java_lang_Object::callVoidMethodWithIntArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const
{ {
SDBThreadAttach t; SDBThreadAttach t;
...@@ -326,7 +337,7 @@ void java_lang_Object::callVoidMethodWithIntArg_Nothrow( const char* _pMethodNam ...@@ -326,7 +337,7 @@ void java_lang_Object::callVoidMethodWithIntArg_Nothrow( const char* _pMethodNam
// call method // call method
t.pEnv->CallVoidMethod( object, _inout_MethodID,_nArgument ); 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 void java_lang_Object::callVoidMethodWithBoolArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument ) const
......
...@@ -169,7 +169,7 @@ void SAL_CALL java_sql_PreparedStatement::setBoolean( sal_Int32 parameterIndex, ...@@ -169,7 +169,7 @@ void SAL_CALL java_sql_PreparedStatement::setBoolean( sal_Int32 parameterIndex,
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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 ...@@ -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!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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 ...@@ -196,7 +196,7 @@ void SAL_CALL java_sql_PreparedStatement::setDate( sal_Int32 parameterIndex, con
createStatement(t.pEnv); createStatement(t.pEnv);
java_sql_Date aT(x); java_sql_Date aT(x);
static jmethodID mID(NULL); 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 ...@@ -211,7 +211,7 @@ void SAL_CALL java_sql_PreparedStatement::setTime( sal_Int32 parameterIndex, con
createStatement(t.pEnv); createStatement(t.pEnv);
java_sql_Time aT(x); java_sql_Time aT(x);
static jmethodID mID(NULL); 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 ...@@ -225,7 +225,7 @@ void SAL_CALL java_sql_PreparedStatement::setTimestamp( sal_Int32 parameterIndex
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); static jmethodID mID(NULL);
java_sql_Timestamp aD(x); 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) 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 ...@@ -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!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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 ...@@ -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!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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_ ...@@ -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!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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 ...@@ -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!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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 ...@@ -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!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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 ...@@ -385,7 +385,7 @@ void SAL_CALL java_sql_PreparedStatement::setObjectNull( sal_Int32 parameterInde
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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 ...@@ -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!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); 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:: ...@@ -549,7 +549,7 @@ void SAL_CALL java_sql_PreparedStatement::clearParameters( ) throw(::com::sun::
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("clearParameters",mID); callVoidMethod_Throw("clearParameters",mID);
} //t.pEnv } //t.pEnv
} }
...@@ -561,7 +561,7 @@ void SAL_CALL java_sql_PreparedStatement::clearBatch( ) throw(::com::sun::star: ...@@ -561,7 +561,7 @@ void SAL_CALL java_sql_PreparedStatement::clearBatch( ) throw(::com::sun::star:
{ {
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("clearBatch",mID); callVoidMethod_Throw("clearBatch",mID);
} //t.pEnv } //t.pEnv
} }
...@@ -574,7 +574,7 @@ void SAL_CALL java_sql_PreparedStatement::addBatch( ) throw(::com::sun::star::sd ...@@ -574,7 +574,7 @@ void SAL_CALL java_sql_PreparedStatement::addBatch( ) throw(::com::sun::star::sd
{ {
createStatement(t.pEnv); createStatement(t.pEnv);
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("addBatch",mID); callVoidMethod_Throw("addBatch", mID);
} //t.pEnv } //t.pEnv
} }
......
...@@ -75,7 +75,7 @@ sal_Int32 SAL_CALL java_io_Reader::available( ) throw(::com::sun::star::io::Not ...@@ -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) 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); 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) 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)
......
...@@ -96,8 +96,7 @@ jclass java_sql_ResultSet::getMyClass() const ...@@ -96,8 +96,7 @@ jclass java_sql_ResultSet::getMyClass() const
return theClass; return theClass;
} }
void java_sql_ResultSet::disposing()
void java_sql_ResultSet::disposing(void)
{ {
OPropertySetHelper::disposing(); OPropertySetHelper::disposing();
...@@ -107,7 +106,7 @@ m_xMetaData.clear(); ...@@ -107,7 +106,7 @@ m_xMetaData.clear();
{ {
SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("close",mID); callVoidMethod_Throw("close", mID);
clearObject(*t.pEnv); clearObject(*t.pEnv);
} }
...@@ -407,13 +406,13 @@ sal_Bool SAL_CALL java_sql_ResultSet::isLast( ) throw(SQLException, RuntimeExce ...@@ -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) void SAL_CALL java_sql_ResultSet::beforeFirst( ) throw(SQLException, RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); static jmethodID mID(NULL);
callVoidMethod("beforeFirst",mID); callVoidMethod_Throw("beforeFirst", mID);
} }
void SAL_CALL java_sql_ResultSet::afterLast( ) throw(SQLException, RuntimeException, std::exception) void SAL_CALL java_sql_ResultSet::afterLast( ) throw(SQLException, RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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 ...@@ -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) void SAL_CALL java_sql_ResultSet::cancel( ) throw(::com::sun::star::uno::RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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) void SAL_CALL java_sql_ResultSet::clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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) ::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 ...@@ -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) void SAL_CALL java_sql_ResultSet::insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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) void SAL_CALL java_sql_ResultSet::updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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) void SAL_CALL java_sql_ResultSet::deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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) void SAL_CALL java_sql_ResultSet::cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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) void SAL_CALL java_sql_ResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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) void SAL_CALL java_sql_ResultSet::moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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 ...@@ -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) 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); 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) 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); 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) 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); 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) 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); 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) 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); 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 ...@@ -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) 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); 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) 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); 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 ...@@ -683,7 +682,7 @@ void SAL_CALL java_sql_ResultSet::updateDate( sal_Int32 columnIndex, const ::com
{ {
java_sql_Date aD(x); java_sql_Date aD(x);
static jmethodID mID(NULL); 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 ...@@ -691,7 +690,7 @@ void SAL_CALL java_sql_ResultSet::updateTime( sal_Int32 columnIndex, const ::com
{ {
java_sql_Time aD(x); java_sql_Time aD(x);
static jmethodID mID(NULL); 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 ...@@ -699,7 +698,7 @@ void SAL_CALL java_sql_ResultSet::updateTimestamp( sal_Int32 columnIndex, const
{ {
java_sql_Timestamp aD(x); java_sql_Timestamp aD(x);
static jmethodID mID(NULL); 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 ...@@ -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) void SAL_CALL java_sql_ResultSet::refreshRow( ) throw(SQLException, RuntimeException, std::exception)
{ {
static jmethodID mID(NULL); 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) void java_sql_ResultSet::setFetchSize(sal_Int32 _par0) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
......
...@@ -59,7 +59,7 @@ OUString java_lang_Throwable::getLocalizedMessage() const ...@@ -59,7 +59,7 @@ OUString java_lang_Throwable::getLocalizedMessage() const
void java_lang_Throwable::printStackTrace() const void java_lang_Throwable::printStackTrace() const
{ {
static jmethodID mID(NULL); static jmethodID mID(NULL);
return callVoidMethod("printStackTrace",mID); return callVoidMethod_Throw("printStackTrace",mID);
} }
#endif #endif
......
...@@ -120,7 +120,8 @@ namespace connectivity ...@@ -120,7 +120,8 @@ namespace connectivity
sal_Int32 callIntMethodWithStringArg( const char* _pMethodName, jmethodID& _inout_MethodID,const OUString& _nArgument ) const; sal_Int32 callIntMethodWithStringArg( const char* _pMethodName, jmethodID& _inout_MethodID,const OUString& _nArgument ) const;
OUString callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const; OUString callStringMethod( const char* _pMethodName, jmethodID& _inout_MethodID ) const;
OUString callStringMethodWithIntArg( const char* _pMethodName, jmethodID& _inout_MethodID , sal_Int32 _nArgument) 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_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 callVoidMethodWithIntArg_Nothrow( const char* _pMethodName, jmethodID& _inout_MethodID, sal_Int32 _nArgument ) const;
void callVoidMethodWithBoolArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument ) const; void callVoidMethodWithBoolArg_Throw( const char* _pMethodName, jmethodID& _inout_MethodID, bool _nArgument ) const;
...@@ -140,7 +141,7 @@ namespace connectivity ...@@ -140,7 +141,7 @@ namespace connectivity
} }
template< typename T > 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; SDBThreadAttach t;
obtainMethodId(t.pEnv, _pMethodName,_pSignature, _inout_MethodID); obtainMethodId(t.pEnv, _pMethodName,_pSignature, _inout_MethodID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment