diff options
author | Robert Antoni Buj i Gelonch <robert.buj@gmail.com> | 2014-10-14 11:57:25 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-14 12:28:37 +0000 |
commit | 791ed2c654509c8e20af473d5413e8031bceddc0 (patch) | |
tree | 63cf822f52b583ccd827789522213835748e520c /scripting/java | |
parent | 530f060e41aa28634c133dab2e606907010d3cc3 (diff) |
scripting: use new exception constructors
Change-Id: I7eeece85d4e462bf2df010ee29c062941a677759
Reviewed-on: https://gerrit.libreoffice.org/11966
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'scripting/java')
5 files changed, 9 insertions, 15 deletions
diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java index be72d785e9e1..b641cd038b66 100644 --- a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java +++ b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java @@ -193,10 +193,7 @@ public class ParcelContainer implements XNameAccess { name = decodedUrl.substring(indexOfSlash + 1); } } catch (UnsupportedEncodingException e) { - com.sun.star.uno.RuntimeException e2 = - new com.sun.star.uno.RuntimeException(); - e2.initCause(e); - throw e2; + throw new com.sun.star.uno.RuntimeException(e); } } else { name = "document"; diff --git a/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java b/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java index db30afb201d9..cc4094d82024 100644 --- a/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java +++ b/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java @@ -218,9 +218,9 @@ public class ScriptMetaData extends ScriptEntry { if (url != null) { classPathVec.add(url); } - } + } - return classPathVec.toArray(new URL[classPathVec.size()]); + return classPathVec.toArray(new URL[classPathVec.size()]); } catch (Exception e) { LogUtils.DEBUG("Failed to build class path " + e.toString()); LogUtils.DEBUG(LogUtils.getTrace(e)); diff --git a/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java b/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java index 05384a76f1dd..79f933cdeae4 100644 --- a/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java +++ b/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java @@ -117,7 +117,8 @@ public class UCBStreamHandler extends URLStreamHandler { try { String sUrl = url.toString(); - if ( sUrl.lastIndexOf(separator) != -1 ) { + + if (sUrl.lastIndexOf(separator) != -1) { String path = sUrl.substring(0, sUrl.lastIndexOf(separator)); if (m_xSimpleFileAccess.isReadOnly(path)) { diff --git a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java index 8daf836abcc9..497b0731ce1e 100644 --- a/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java +++ b/scripting/java/com/sun/star/script/framework/provider/ScriptProvider.java @@ -131,10 +131,8 @@ public abstract class ScriptProvider implements } catch (Exception e) { LogUtils.DEBUG(LogUtils.getTrace(e)); - com.sun.star.uno.RuntimeException e2 = new com.sun.star.uno.RuntimeException( - "Error constructing ScriptProvider: " + e); - e2.initCause(e); - throw e2; + throw new com.sun.star.uno.RuntimeException( + e, "Error constructing ScriptProvider: " + e); } LogUtils.DEBUG("ScriptProvider: constructor - finished."); diff --git a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java index bc896cb2103e..881ae816cce8 100644 --- a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java +++ b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java @@ -147,10 +147,8 @@ class ScriptImpl implements XScript { this.m_xMultiComponentFactory = m_xContext.getServiceManager(); } catch (Exception e) { LogUtils.DEBUG(LogUtils.getTrace(e)); - com.sun.star.uno.RuntimeException e2 = new com.sun.star.uno.RuntimeException( - "Error constructing ScriptProvider: " + e); - e2.initCause(e); - throw e2; + throw new com.sun.star.uno.RuntimeException( + e, "Error constructing ScriptProvider: " + e); } LogUtils.DEBUG("ScriptImpl [java] script data = " + metaData); |