diff options
author | Kay Ramme <kr@openoffice.org> | 2001-02-19 09:00:07 +0000 |
---|---|---|
committer | Kay Ramme <kr@openoffice.org> | 2001-02-19 09:00:07 +0000 |
commit | 6432c6c1da26b9f7d164ffd23eaa7c08f5bd6c16 (patch) | |
tree | a640c53e7d13e24625a5de0d1b64b87c4cc522b9 /jurt | |
parent | dabc28fde66874e26ac2ea084fa4a8ce0a358e06 (diff) |
let a possible exception from >createInstance< fly through
Diffstat (limited to 'jurt')
-rw-r--r-- | jurt/com/sun/star/comp/loader/FactoryHelper.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/jurt/com/sun/star/comp/loader/FactoryHelper.java b/jurt/com/sun/star/comp/loader/FactoryHelper.java index c22ccf05840a..0fba32df6a38 100644 --- a/jurt/com/sun/star/comp/loader/FactoryHelper.java +++ b/jurt/com/sun/star/comp/loader/FactoryHelper.java @@ -2,9 +2,9 @@ * * $RCSfile: FactoryHelper.java,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: kr $ $Date: 2000-11-28 14:46:09 $ + * last change: $Author: kr $ $Date: 2001-02-19 10:00:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,7 +82,7 @@ import com.sun.star.uno.UnoRuntime; * This class has default implementations for <code>getServiceFactory</code> * and <code>writeRegistryServiceInfo</code>. * <p> - * @version $Revision: 1.3 $ $ $Date: 2000-11-28 14:46:09 $ + * @version $Revision: 1.4 $ $ $Date: 2001-02-19 10:00:07 $ * @author Kay Ramme * @see com.sun.star.lang.XMultiServiceFactory * @see com.sun.star.lang.XServiceInfo @@ -185,14 +185,19 @@ public class FactoryHelper { instance = _constructor.newInstance(_parameters); } catch(InvocationTargetException invocationTargetException) { - System.err.println("##### " + getClass().getName() + ".createInstance:" + invocationTargetException); - invocationTargetException.printStackTrace(); + Throwable targetException = invocationTargetException.getTargetException(); - Throwable throwable = invocationTargetException.getTargetException(); - System.err.println("##### " + getClass().getName() + ".createInstance:" + throwable); - throwable.printStackTrace(); + if(targetException instanceof java.lang.RuntimeException) + throw (java.lang.RuntimeException)targetException; - throw new com.sun.star.uno.Exception(invocationTargetException.toString()); + else if(targetException instanceof com.sun.star.uno.Exception) + throw (com.sun.star.uno.Exception)targetException; + + else if(targetException instanceof com.sun.star.uno.RuntimeException) + throw (com.sun.star.uno.RuntimeException)targetException; + + else + throw new com.sun.star.uno.Exception(targetException.toString()); } catch(IllegalAccessException illegalAccessException) { throw new com.sun.star.uno.Exception(illegalAccessException.toString()); |