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>
This commit is contained in:
Robert Antoni Buj i Gelonch
2014-10-14 11:57:25 +02:00
committed by Noel Grandin
parent 530f060e41
commit 791ed2c654
5 changed files with 9 additions and 15 deletions

View File

@@ -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";

View File

@@ -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));

View File

@@ -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)) {

View File

@@ -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.");

View File

@@ -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);