diff options
-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) { |