diff options
author | Thomas Watson | 2011-11-15 20:49:11 +0000 |
---|---|---|
committer | Thomas Watson | 2011-11-15 20:49:11 +0000 |
commit | 7474c98f5dd8478c5bd00d46ce42e514069b13da (patch) | |
tree | 7776b794acee1e79469ec771f5c9f32759fe48b4 | |
parent | dcd6d13be314011896ae760cf20c45732d846030 (diff) | |
download | rt.equinox.framework-7474c98f5dd8478c5bd00d46ce42e514069b13da.tar.gz rt.equinox.framework-7474c98f5dd8478c5bd00d46ce42e514069b13da.tar.xz rt.equinox.framework-7474c98f5dd8478c5bd00d46ce42e514069b13da.zip |
Bug 363797 - NullPointerException in CompositeConfigurator.createClassLoaderR37x_v20111115-1600
2 files changed, 24 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/composites/CompositeShareTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/composites/CompositeShareTests.java index f44adf87a..2e5e3d73f 100644 --- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/composites/CompositeShareTests.java +++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/composites/CompositeShareTests.java @@ -295,6 +295,27 @@ public class CompositeShareTests extends AbstractCompositeTests { uninstallCompositeBundle(compositeBundle); } + public void testCompositeShare04d_Bug363561() { + // create a composite bundle with one bundle that exports some api to parent + // install one bundle into parent that uses API from child + Map linkManifest = new HashMap(); + linkManifest.put(Constants.BUNDLE_SYMBOLICNAME, getName()); //$NON-NLS-1$ + linkManifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$ + linkManifest.put(Constants.EXPORT_PACKAGE, "test.link.a; attr1=\"value1\"; uses:=\"org.osgi.framework, test.link.a.params\", test.link.a.params; attr2=\"value2\""); //$NON-NLS-1$ + CompositeBundle compositeBundle = createCompositeBundle(linkBundleFactory, "testCompositeShare04a", null, linkManifest, false, false); //$NON-NLS-1$ + Bundle constituent = installIntoChild(compositeBundle.getCompositeFramework(), "test.link.a"); //$NON-NLS-1$ + Bundle testClient = installIntoCurrent("test.link.a.client"); //$NON-NLS-1$ + startCompositeBundle(compositeBundle, false); + + try { + constituent.uninstall(); + } catch (BundleException e) { + fail("Error on uninstall of constituent.", e); + } + stopCompositeBundle(compositeBundle); + uninstallCompositeBundle(compositeBundle); + } + public void testCompositeShare05() { // create a composite bundle with one bundle that exports some api to child // install one bundle into child that uses API from parent diff --git a/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeImpl.java b/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeImpl.java index 329009bcd..807fb5bc7 100644 --- a/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeImpl.java +++ b/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeImpl.java @@ -169,6 +169,9 @@ public class CompositeImpl extends CompositeBase implements CompositeBundle { } protected void stopHook() throws BundleException { + // bug 363561; need to make sure the class loader is created + // before stopping the composite framework + checkClassLoader(); trackerManager.stoppedComposite(); // do not stop the framework unless we are persistently stopped if ((bundledata.getStatus() & Constants.BUNDLE_STARTED) == 0) |