diff options
author | Thomas Watson | 2017-12-15 15:51:16 +0000 |
---|---|---|
committer | Thomas Watson | 2017-12-15 15:51:16 +0000 |
commit | 4228f684eb8e2a17664dd6e3246650f4326be42d (patch) | |
tree | 49401f0cb931a87935cf0fffb255b8b40000f2d7 /bundles/org.eclipse.osgi/container | |
parent | 9b4f5003d023e28cea08b608f76ef953c065e255 (diff) | |
download | rt.equinox.framework-4228f684eb8e2a17664dd6e3246650f4326be42d.tar.gz rt.equinox.framework-4228f684eb8e2a17664dd6e3246650f4326be42d.tar.xz rt.equinox.framework-4228f684eb8e2a17664dd6e3246650f4326be42d.zip |
Bug 528777 - Unable to launch existing Eclipse application launch
configuration
Need to make sure to discard modules with deleted/modified content
before checking for multi-release bundles.
Diffstat (limited to 'bundles/org.eclipse.osgi/container')
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java index 31b4b6fdb..4a1156ac8 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java @@ -151,7 +151,7 @@ public class Storage { Storage storage = new Storage(container); // Do some operations that need to happen on the fully constructed Storage before returning it storage.checkSystemBundle(); - storage.discardBundlesOnLoad(); + storage.refreshStaleBundles(); storage.installExtensions(); // TODO hack to make sure all bundles are in UNINSTALLED state before system bundle init is called storage.getModuleContainer().setInitialModuleStates(); @@ -296,21 +296,30 @@ public class Storage { return permData; } - private void discardBundlesOnLoad() throws BundleException { - Collection<Module> discarded = new ArrayList<>(0); + private void refreshStaleBundles() throws BundleException { + Collection<Module> needsRefresh = new ArrayList<>(0); + + // First uninstall any modules that had their content changed or deleted for (Module module : moduleContainer.getModules()) { if (module.getId() == Constants.SYSTEM_BUNDLE_ID) continue; ModuleRevision revision = module.getCurrentRevision(); Generation generation = (Generation) revision.getRevisionInfo(); if (needsDiscarding(generation)) { - discarded.add(module); + needsRefresh.add(module); moduleContainer.uninstall(module); generation.delete(); } } - if (!discarded.isEmpty()) { - moduleContainer.refresh(discarded); + // Next check if we need to refresh Multi-Release Jar bundles + // because the runtime version changed. + if (refreshMRBundles.get()) { + needsRefresh.addAll(refreshMRJarBundles()); + } + + // refresh the modules that got deleted or are Multi-Release bundles + if (!needsRefresh.isEmpty()) { + moduleContainer.refresh(needsRefresh); } } @@ -371,10 +380,6 @@ public class Storage { moduleContainer.resolve(Collections.singleton(systemModule), true); } } - if (refreshMRBundles.get()) { - Collection<Module> toRefresh = refreshMRJarBundles(); - moduleContainer.refresh(toRefresh); - } } catch (BundleException e) { throw new IllegalStateException("Could not create a builder for the system bundle.", e); //$NON-NLS-1$ } |