diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-03 09:40:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-10-03 12:09:23 +0000 |
commit | cae57d2e588a4b5a104171e022b00abcc1605775 (patch) | |
tree | 964e3d574add51b848fa9b204260e9b0fa1e2aaf /scripting/java | |
parent | 3fcd1f80afcf789fbafae2a4360b62111089a5cd (diff) |
ClassLoader->URLClassLoader
Change-Id: I1f46a99025ba33d08842da9b06611dcfa6b1b49c
Reviewed-on: https://gerrit.libreoffice.org/29474
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'scripting/java')
4 files changed, 10 insertions, 7 deletions
diff --git a/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java b/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java index b3f3c50b8603..73ba06938884 100644 --- a/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java +++ b/scripting/java/com/sun/star/script/framework/provider/ClassLoaderFactory.java @@ -31,7 +31,7 @@ public class ClassLoaderFactory { private ClassLoaderFactory() {} - public static ClassLoader getURLClassLoader(ScriptMetaData scriptData) { + public static URLClassLoader getURLClassLoader(ScriptMetaData scriptData) { ClassLoader parent = scriptData.getClass().getClassLoader(); URL[] classPath = scriptData.getClassPath(); LogUtils.DEBUG("Classpath has length " + classPath.length); @@ -43,8 +43,8 @@ public class ClassLoaderFactory { return getURLClassLoader(parent, classPath); } - private static ClassLoader getURLClassLoader(ClassLoader parent, + private static URLClassLoader getURLClassLoader(ClassLoader parent, URL[] classpath) { return new URLClassLoader(classpath, parent); } -}
\ No newline at end of file +} diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java index c832e6ed691f..9c1f583a4317 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java @@ -35,6 +35,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.URL; +import java.net.URLClassLoader; import java.util.HashMap; import java.util.Map; @@ -181,14 +182,14 @@ public class ScriptEditorForBeanShell implements ScriptEditor, ActionListener { public void edit(final XScriptContext context, ScriptMetaData entry) { if (entry != null) { try { - ClassLoader cl = null; + URLClassLoader cl = null; try { cl = ClassLoaderFactory.getURLClassLoader(entry); } catch (Exception ignore) { // TODO re-examine error handling } - final ClassLoader theCl = cl; + final URLClassLoader theCl = cl; final URL url = entry.getSourceURL(); SwingInvocation.invoke( new Runnable() { diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java index 2aabba71242b..4caf64578800 100644 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java @@ -50,6 +50,7 @@ import com.sun.star.uno.Type; import com.sun.star.uno.XComponentContext; import java.net.URL; +import java.net.URLClassLoader; import java.util.StringTokenizer; @@ -182,7 +183,7 @@ class ScriptImpl implements XScript { aOutParamIndex[0] = new short[0]; aOutParam[0] = new Object[0]; - ClassLoader cl = null; + URLClassLoader cl = null; URL sourceUrl = null; try { diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java index 9465a646f64d..fcd08cd2e9ca 100644 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java @@ -45,6 +45,7 @@ import com.sun.star.script.provider.XScript; import com.sun.star.uno.XComponentContext; import java.net.URL; +import java.net.URLClassLoader; import org.mozilla.javascript.Context; import org.mozilla.javascript.ImporterTopLevel; @@ -181,7 +182,7 @@ class ScriptImpl implements XScript { aOutParamIndex[0] = new short[0]; aOutParam[0] = new Object[0]; - ClassLoader cl = null; + URLClassLoader cl = null; try { cl = ClassLoaderFactory.getURLClassLoader(metaData); |