diff options
author | Thomas Watson | 2016-09-26 14:27:23 +0000 |
---|---|---|
committer | Thomas Watson | 2016-09-26 15:53:09 +0000 |
commit | d3984e9179af023a8753216322abb6c2eeea1fe9 (patch) | |
tree | cf1ae238d45795943a9f2033c890faff436fb8e8 | |
parent | a9abe271aa30b4cdf0c7f970c0c12b8d8b7848fe (diff) | |
download | rt.equinox.framework-d3984e9179af023a8753216322abb6c2eeea1fe9.tar.gz rt.equinox.framework-d3984e9179af023a8753216322abb6c2eeea1fe9.tar.xz rt.equinox.framework-d3984e9179af023a8753216322abb6c2eeea1fe9.zip |
Bug 502108 - Initialization of FrameworkExtensionInstaller fails withI20160927-0800
JDK9
Change-Id: Idf30e3c56eff1b8ae48b7138539e82da150c4af6
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r-- | bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java | 11 | ||||
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/FrameworkExtensionInstaller.java | 6 |
2 files changed, 15 insertions, 2 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 a1057f51b..3d75b6210 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 @@ -2825,7 +2825,7 @@ public class Main { } } - private class StartupClassLoader extends URLClassLoader { + public class StartupClassLoader extends URLClassLoader { public StartupClassLoader(URL[] urls) { super(urls); @@ -2850,6 +2850,15 @@ public class Main { } return super.findLibrary(name); } + + /** + * Must override addURL to make it public so the framework can + * do deep reflection to add URLs on Java 9. + */ + @Override + public void addURL(URL url) { + super.addURL(url); + } } private Properties substituteVars(Properties result) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/FrameworkExtensionInstaller.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/FrameworkExtensionInstaller.java index 9c39e245b..c7db7fe8f 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/FrameworkExtensionInstaller.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/FrameworkExtensionInstaller.java @@ -54,6 +54,8 @@ public class FrameworkExtensionInstaller { // do nothing look in super class below } catch (SecurityException e) { // if we do not have the permissions then we will not find the method + } catch (RuntimeException e) { + // have to avoid blowing up <clinit> } return findMethod(clazz.getSuperclass(), name, args); } @@ -92,7 +94,9 @@ public class FrameworkExtensionInstaller { void addExtensionContent0(Collection<ModuleRevision> revisions, Module systemModule) throws BundleException { if (CL == null || ADD_FWK_URL_METHOD == null) { - return; + // use the first revision as the blame + ModuleRevision revision = revisions.isEmpty() ? null : revisions.iterator().next(); + throw new BundleException("Cannot support framework extension bundles without a public addURL(URL) method on the framework class loader: " + revision.getBundle()); //$NON-NLS-1$ } for (ModuleRevision revision : revisions) { |