[Libreoffice-commits] core.git: jurt/com

rbuj robert.buj at gmail.com
Tue Aug 19 23:51:19 PDT 2014


 jurt/com/sun/star/comp/loader/FactoryHelper.java       |    4 ++--
 jurt/com/sun/star/comp/loader/JavaLoader.java          |    2 +-
 jurt/com/sun/star/lib/uno/environments/remote/Job.java |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 37c49c305852f4a58e010c63331ba302462754d9
Author: rbuj <robert.buj at gmail.com>
Date:   Tue Aug 19 21:34:58 2014 +0200

    jurt: Throwable.getCause() instead of Throwable.getTargetException()
    
    As of the JDK 1.4, Throwable.getCause() is the preferred method for getting thrown target exception.
    
    Change-Id: I14f3f9ae52869d1149f92b32562e7fb3293109b5
    Reviewed-on: https://gerrit.libreoffice.org/11027
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/jurt/com/sun/star/comp/loader/FactoryHelper.java b/jurt/com/sun/star/comp/loader/FactoryHelper.java
index 2a71201..92b4801 100644
--- a/jurt/com/sun/star/comp/loader/FactoryHelper.java
+++ b/jurt/com/sun/star/comp/loader/FactoryHelper.java
@@ -198,7 +198,7 @@ public class FactoryHelper {
             try {
                 return _constructor.newInstance( args );
             } catch (InvocationTargetException invocationTargetException) {
-                Throwable targetException = invocationTargetException.getTargetException();
+                Throwable targetException = invocationTargetException.getCause();
 
                 if (targetException instanceof java.lang.RuntimeException)
                     throw (java.lang.RuntimeException)targetException;
@@ -274,7 +274,7 @@ public class FactoryHelper {
                 }
                 return instance;
             } catch (InvocationTargetException invocationTargetException) {
-                Throwable targetException = invocationTargetException.getTargetException();
+                Throwable targetException = invocationTargetException.getCause();
 
                 if (targetException instanceof java.lang.RuntimeException)
                     throw (java.lang.RuntimeException)targetException;
diff --git a/jurt/com/sun/star/comp/loader/JavaLoader.java b/jurt/com/sun/star/comp/loader/JavaLoader.java
index d7f757a..c82f8e9 100644
--- a/jurt/com/sun/star/comp/loader/JavaLoader.java
+++ b/jurt/com/sun/star/comp/loader/JavaLoader.java
@@ -353,7 +353,7 @@ public class JavaLoader implements XImplementationLoader,
                         + implementationName + " because " + e.toString() );
         } catch ( InvocationTargetException e ) {
             throw new CannotActivateFactoryException("Can not activate the factory for "
-                        + implementationName + " because " + e.getTargetException().toString() );
+                        + implementationName + " because " + e.getCause().toString() );
         }
 
         return returnObject;
diff --git a/jurt/com/sun/star/lib/uno/environments/remote/Job.java b/jurt/com/sun/star/lib/uno/environments/remote/Job.java
index 47fc033..1d8b366 100644
--- a/jurt/com/sun/star/lib/uno/environments/remote/Job.java
+++ b/jurt/com/sun/star/lib/uno/environments/remote/Job.java
@@ -90,7 +90,7 @@ public class Job {
                     ? dispatch_queryInterface((Type) args[0])
                     : md.getMethod().invoke(_object, args);
             } catch (InvocationTargetException e) {
-                exception = e.getTargetException();
+                exception = e.getCause();
                 if (exception == null) {
                     exception = e;
                 }


More information about the Libreoffice-commits mailing list