diff options
author | Robert Antoni Buj i Gelonch <robert.buj@gmail.com> | 2014-10-09 20:53:02 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-10 06:18:42 +0000 |
commit | 7afbb8275667ca8157be5449536e671bbac9f988 (patch) | |
tree | 8f5844329252ef912a3f9a1185f548880d77c1dc /jurt | |
parent | 017ea9eb0f80ba750f0cf917033052c75e622c0a (diff) |
jurt: use new exception constructors
Change-Id: I58e7ebdd5c48094142f93f47271bcc0cc8b97981
Reviewed-on: https://gerrit.libreoffice.org/11892
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'jurt')
-rw-r--r-- | jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java | 5 | ||||
-rw-r--r-- | jurt/com/sun/star/comp/loader/JavaLoader.java | 20 | ||||
-rw-r--r-- | jurt/com/sun/star/comp/servicemanager/ServiceManager.java | 6 |
3 files changed, 6 insertions, 25 deletions
diff --git a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java index 7e370a980174..7dd6fcf6762a 100644 --- a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java +++ b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java @@ -124,10 +124,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { xBridge = UnoRuntime.queryInterface(XBridge.class, iBridge); } catch (Exception e) { - com.sun.star.lang.IllegalArgumentException e2 = - new com.sun.star.lang.IllegalArgumentException(e.getMessage()); - e2.initCause(e); - throw e2; + throw new com.sun.star.lang.IllegalArgumentException(e, e.getMessage()); } if(DEBUG) System.err.println("##### " + getClass().getName() + ".createBridge:" + sName + " " + sProtocol + " " + aConnection + " " + anInstanceProvider + " " + xBridge); diff --git a/jurt/com/sun/star/comp/loader/JavaLoader.java b/jurt/com/sun/star/comp/loader/JavaLoader.java index 7649d1021253..fb7c6d8372da 100644 --- a/jurt/com/sun/star/comp/loader/JavaLoader.java +++ b/jurt/com/sun/star/comp/loader/JavaLoader.java @@ -279,20 +279,11 @@ public class JavaLoader implements XImplementationLoader, } } } catch (java.net.MalformedURLException e) { - CannotActivateFactoryException cae = new CannotActivateFactoryException( - "Can not activate factory because " + e ); - cae.initCause(e); - throw cae; + throw new CannotActivateFactoryException(e, "Can not activate factory because " + e); } catch (java.io.IOException e) { - CannotActivateFactoryException cae = new CannotActivateFactoryException( - "Can not activate factory because " + e ); - cae.initCause(e); - throw cae; + throw new CannotActivateFactoryException(e, "Can not activate factory because " + e); } catch (java.lang.ClassNotFoundException e) { - CannotActivateFactoryException cae = new CannotActivateFactoryException( - "Can not activate factory because " + e ); - cae.initCause(e); - throw cae; + throw new CannotActivateFactoryException(e, "Can not activate factory because " + e); } Class<?>[] paramTypes = {String.class, XMultiServiceFactory.class, XRegistryKey.class}; @@ -400,10 +391,7 @@ public class JavaLoader implements XImplementationLoader, if ( (oRet != null) && (oRet instanceof Boolean) ) success = ((Boolean) oRet).booleanValue(); } catch (Exception e) { - CannotRegisterImplementationException e2 = - new CannotRegisterImplementationException(e.toString()); - e2.initCause(e); - throw e2; + throw new CannotRegisterImplementationException(e, e.toString()); } return success; diff --git a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java index 729fda5b2215..85f69fd14356 100644 --- a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java +++ b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java @@ -652,11 +652,7 @@ public class ServiceManager implements XMultiServiceFactory, try { return enumeration.next(); } catch (java.util.NoSuchElementException e) { - com.sun.star.container.NoSuchElementException ex = - new com.sun.star.container.NoSuchElementException( - e.toString()); - ex.initCause(e); - throw ex; + throw new com.sun.star.container.NoSuchElementException(e, e.toString()); } } } |