Kaydet (Commit) 0f44079c authored tarafından Takeshi Abe's avatar Takeshi Abe

catch exception by constant reference

üst 535e37ab
......@@ -320,7 +320,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
::rtl::OUString::createFromAscii(argv[4]),
::rtl::OUString::createFromAscii(argv[5]), true );
}
catch ( Exception &e )
catch ( const Exception &e )
{
printf( "Exception on createRegistryServiceFactory %s\n",
OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() );
......@@ -358,7 +358,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
rParser->parseStream( source );
}
catch( Exception & e )
catch( const Exception & e )
{
OString o1 = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8 );
printf( "Exception during parsing : %s\n" , o1.getStr() );
......
......@@ -49,7 +49,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if (!options.initOptions(args))
return (0);
}
catch( IllegalArgument& e)
catch(const IllegalArgument& e)
{
fprintf(stderr, "Illegal argument: %s\n%s",
e.m_message.getStr(),
......
......@@ -242,7 +242,7 @@ namespace io_acceptor
}
}
}
catch (rtl::MalformedUriException & rEx)
catch (const rtl::MalformedUriException & rEx)
{
throw IllegalArgumentException(
rEx.getMessage(),
......
......@@ -192,7 +192,7 @@ namespace stoc_connector
}
return r;
}
catch (rtl::MalformedUriException & rEx)
catch (const rtl::MalformedUriException & rEx)
{
throw ConnectionSetupException(rEx.getMessage(),
Reference< XInterface > ());
......
......@@ -144,7 +144,7 @@ void Pump::fireError( const Any & exception )
{
static_cast< XStreamListener * > ( iter.next() )->error( exception );
}
catch ( RuntimeException &e )
catch ( const RuntimeException &e )
{
OString sMessage = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
OSL_ENSURE( !"com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners", sMessage.getStr() );
......@@ -173,7 +173,7 @@ void Pump::fireClose()
{
static_cast< XStreamListener * > ( iter.next() )->closed( );
}
catch ( RuntimeException &e )
catch ( const RuntimeException &e )
{
OString sMessage = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
OSL_ENSURE( !"com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners", sMessage.getStr() );
......@@ -191,7 +191,7 @@ void Pump::fireStarted()
{
static_cast< XStreamListener * > ( iter.next() )->started( );
}
catch ( RuntimeException &e )
catch ( const RuntimeException &e )
{
OString sMessage = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
OSL_ENSURE( !"com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners", sMessage.getStr() );
......@@ -208,7 +208,7 @@ void Pump::fireTerminated()
{
static_cast< XStreamListener * > ( iter.next() )->terminated();
}
catch ( RuntimeException &e )
catch ( const RuntimeException &e )
{
OString sMessage = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
OSL_ENSURE( !"com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners", sMessage.getStr() );
......@@ -297,15 +297,15 @@ void Pump::run()
osl_yieldThread();
}
}
catch ( IOException & e )
catch ( const IOException & e )
{
fireError( makeAny( e ) );
}
catch ( RuntimeException & e )
catch ( const RuntimeException & e )
{
fireError( makeAny( e ) );
}
catch ( Exception & e )
catch ( const Exception & e )
{
fireError( makeAny( e ) );
}
......@@ -313,7 +313,7 @@ void Pump::run()
close();
fireClose();
}
catch ( com::sun::star::uno::Exception &e )
catch ( const com::sun::star::uno::Exception &e )
{
// we are the last on the stack.
// this is to avoid crashing the program, when e.g. a bridge crashes
......
......@@ -213,7 +213,7 @@ sal_Int32 ODataStreamTest::test(
}
}
}
catch( Exception & e )
catch( const Exception & e )
{
OString o = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
BUILD_ERROR( 0 , o.getStr() );
......@@ -796,7 +796,7 @@ sal_Int32 OObjectStreamTest::test( const OUString& TestName,
}
}
catch( Exception &e ) {
catch( const Exception &e ) {
OString o = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
BUILD_ERROR( 0 , o.getStr() );
}
......
......@@ -158,7 +158,7 @@ sal_Int32 OMarkableOutputStreamTest::test(
}
}
catch( Exception &e )
catch( const Exception &e )
{
OString o = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
BUILD_ERROR( 0 , o.getStr() );
......@@ -525,7 +525,7 @@ sal_Int32 OMarkableInputStreamTest::test(
}
}
catch( Exception & e )
catch( const Exception & e )
{
OString o = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
BUILD_ERROR( 0 , o.getStr() );
......
......@@ -190,7 +190,7 @@ sal_Int32 OPipeTest::test(
testMultithreading( TestObject );
}
}
catch( Exception & e )
catch( const Exception & e )
{
OString s = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
BUILD_ERROR( 0 , s.getStr() );
......
......@@ -174,7 +174,7 @@ sal_Int32 OPumpTest::test(
testFunction( TestObject );
}
}
catch( Exception & e )
catch( const Exception & e )
{
OString s = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
BUILD_ERROR( 0 , s.getStr() );
......
......@@ -93,7 +93,7 @@ int main (int argc, char **argv)
xSimpleReg );
}
}
catch( Exception &e ) {
catch( const Exception &e ) {
printf( "%s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() );
exit(1);
......@@ -119,7 +119,7 @@ int main (int argc, char **argv)
aDllName,
xSimpleReg );
}
catch( Exception & e )
catch( Exception & )
{
printf( "Couldn't reach dll %s\n" , szBuf );
exit(1);
......@@ -163,7 +163,7 @@ int main (int argc, char **argv)
nNewHandle = xTest->test(
OStringToOUString( argv[1] , RTL_TEXTENCODING_ASCII_US ) , x , nHandle );
}
catch( Exception & e ) {
catch( const Exception & e ) {
OString o = OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US );
printf( "testcomponent : uncaught exception %s\n" , o.getStr() );
exit(1);
......
......@@ -97,7 +97,7 @@ void MyThread::run()
{
m_rConnection = m_rAcceptor->accept( m_sConnectionDescription );
}
catch ( Exception &e)
catch ( const Exception &e)
{
OString tmp= OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
printf( "Exception was thrown by acceptor thread: %s\n", tmp.getStr() );
......@@ -261,7 +261,7 @@ int SAL_CALL main( int argc, char * argv[] )
rAcceptor->accept( OUString(RTL_CONSTASCII_USTRINGPARAM("socket,host=localhost,port=2001")) );
OSL_FAIL( "already existing exception expected" );
}
catch( AlreadyAcceptingException & e)
catch( AlreadyAcceptingException & )
{
// everything is fine
}
......
......@@ -160,7 +160,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_com_sun_star_comp_helper_Bootstrap_cpp
return jlocal;
}
catch (RuntimeException & exc)
catch (const RuntimeException & exc)
{
jclass c = jni_env->FindClass( "com/sun/star/uno/RuntimeException" );
if (0 != c)
......@@ -171,7 +171,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_com_sun_star_comp_helper_Bootstrap_cpp
jni_env->ThrowNew( c, cstr.getStr() );
}
}
catch (Exception & exc)
catch (const Exception & exc)
{
jclass c = jni_env->FindClass( "com/sun/star/uno/Exception" );
if (0 != c)
......
......@@ -89,7 +89,7 @@ void * ::jvmaccess::ClassPath::doTranslateToUrls(
css::uno::UNO_QUERY_THROW);
try {
url = expUrl->expand(expander);
} catch (css::lang::IllegalArgumentException & e) {
} catch (const css::lang::IllegalArgumentException & e) {
throw css::uno::RuntimeException(
(::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
......
......@@ -234,7 +234,7 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi
*pSize = nSize;
return errcode;
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
retVal = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -417,7 +417,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti
}
OSL_ASSERT(plerr != JFW_PLUGIN_E_WRONG_VENDOR);
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -626,7 +626,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
errcode = JFW_E_NO_JAVA_FOUND;
}
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -715,7 +715,7 @@ javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo)
return JFW_E_INVALID_SETTINGS;
*ppInfo = aInfo.detach();
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -843,7 +843,7 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
if (*ppInfo == NULL && errcode != JFW_E_FAILED_VERSION)
errcode = JFW_E_NOT_RECOGNIZED;
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -877,7 +877,7 @@ javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *pInfo)
jfw::setJavaSelected();
}
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -910,7 +910,7 @@ javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled)
node.setEnabled(bEnabled);
node.write();
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -932,7 +932,7 @@ javaFrameworkError SAL_CALL jfw_getEnabled(sal_Bool *pbEnabled)
jfw::MergedSettings settings;
*pbEnabled = settings.getEnabled();
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -957,7 +957,7 @@ javaFrameworkError SAL_CALL jfw_setVMParameters(
node.setVmParameters(arOptions, nLen);
node.write();
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -982,7 +982,7 @@ javaFrameworkError SAL_CALL jfw_getVMParameters(
const jfw::MergedSettings settings;
settings.getVmParametersArray(parOptions, pLen);
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -1005,7 +1005,7 @@ javaFrameworkError SAL_CALL jfw_setUserClassPath(rtl_uString * pCp)
node.setUserClassPath(pCp);
node.write();
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -1028,7 +1028,7 @@ javaFrameworkError SAL_CALL jfw_getUserClassPath(rtl_uString ** ppCP)
*ppCP = settings.getUserClassPath().pData;
rtl_uString_acquire(*ppCP);
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -1052,7 +1052,7 @@ javaFrameworkError SAL_CALL jfw_addJRELocation(rtl_uString * sLocation)
node.addJRELocation(sLocation);
node.write();
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -1078,7 +1078,7 @@ javaFrameworkError SAL_CALL jfw_setJRELocations(
node.setJRELocations(arLocations, nLen);
node.write();
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......@@ -1103,7 +1103,7 @@ javaFrameworkError SAL_CALL jfw_getJRELocations(
const jfw::MergedSettings settings;
settings.getJRELocations(parLocations, pLen);
}
catch (jfw::FrameworkException& e)
catch (const jfw::FrameworkException& e)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
......
......@@ -229,7 +229,7 @@ rtl::OUString findPlugin(
{
expandedPlugin = cppu::bootstrap_expandUri(plugin);
}
catch (com::sun::star::lang::IllegalArgumentException & e)
catch (const com::sun::star::lang::IllegalArgumentException & e)
{
throw FrameworkException(
JFW_E_ERROR,
......@@ -244,7 +244,7 @@ rtl::OUString findPlugin(
{
sUrl = rtl::Uri::convertRelToAbs(baseUrl, expandedPlugin);
}
catch (rtl::MalformedUriException & e)
catch (const rtl::MalformedUriException & e)
{
throw FrameworkException(
JFW_E_ERROR,
......
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