Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2016-10-26 12:11:55 -0400
committerThomas Watson2016-10-27 11:52:31 -0400
commite13ed4ada2d35b760bce681b6b7887279d0e6416 (patch)
tree6aca19607f84ad83417a0f70351e4e8a9863392a
parent26c5e36835d9075be96a535db146f05d6982be14 (diff)
downloadrt.equinox.framework-e13ed4ada2d35b760bce681b6b7887279d0e6416.tar.gz
rt.equinox.framework-e13ed4ada2d35b760bce681b6b7887279d0e6416.tar.xz
rt.equinox.framework-e13ed4ada2d35b760bce681b6b7887279d0e6416.zip
Bug 506578 - Custom class loaders mapped to Java 9 modules must override
new findResource and findClass methods Change-Id: I25ab9c6a154314216e9c6ff492b4062f3f4bba42 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java14
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java14
2 files changed, 28 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
index 3d75b6210..34bcf44d3 100644
--- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
+++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java
@@ -2859,6 +2859,20 @@ public class Main {
public void addURL(URL url) {
super.addURL(url);
}
+
+ // preparing for Java 9
+ protected URL findResource(String moduleName, String name) {
+ return findResource(name);
+ }
+
+ // preparing for Java 9
+ protected Class<?> findClass(String moduleName, String name) {
+ try {
+ return findClass(name);
+ } catch (ClassNotFoundException e) {
+ return null;
+ }
+ }
}
private Properties substituteVars(Properties result) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java
index 85c0585cc..f195161ef 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java
@@ -169,6 +169,15 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef
}
}
+ // preparing for Java 9
+ protected Class<?> findClass(String moduleName, String name) {
+ try {
+ return findLocalClass(name);
+ } catch (ClassNotFoundException e) {
+ return null;
+ }
+ }
+
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
return findLocalClass(name);
@@ -199,6 +208,11 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef
return (null);
}
+ // preparing for Java 9
+ protected URL findResource(String moduleName, String name) {
+ return findLocalResource(name);
+ }
+
@Override
protected URL findResource(String name) {
return findLocalResource(name);

Back to the top