Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2012-09-28 17:52:45 -0400
committerThomas Watson2012-09-28 17:52:45 -0400
commit7b63388cf0c3235797d74468c7c0d92560864e99 (patch)
treeba430161b0798b52817080b35093f5469ee99d7a /bundles
parent8100219d624cf3b3bca792259281471217bd7eee (diff)
downloadrt.equinox.framework-7b63388cf0c3235797d74468c7c0d92560864e99.tar.gz
rt.equinox.framework-7b63388cf0c3235797d74468c7c0d92560864e99.tar.xz
rt.equinox.framework-7b63388cf0c3235797d74468c7c0d92560864e99.zip
Fix cleaning up removal pending wires
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleDatabase.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleDatabase.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleDatabase.java
index 988b79a43..737f83e59 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleDatabase.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleDatabase.java
@@ -439,11 +439,37 @@ public class ModuleDatabase {
}
}
if (allPendingRemoval) {
+ Map<ModuleWiring, Collection<ModuleWire>> toRemoveWireLists = new HashMap<ModuleWiring, Collection<ModuleWire>>();
+ for (ModuleRevision pendingRemoval : dependencyClosure) {
+ ModuleWiring removedWiring = wirings.get(pendingRemoval);
+ if (removedWiring == null) {
+ continue;
+ }
+ List<ModuleWire> removedWires = removedWiring.getRequiredModuleWires(null);
+ for (ModuleWire wire : removedWires) {
+ Collection<ModuleWire> providerWires = toRemoveWireLists.get(wire.getProviderWiring());
+ if (providerWires == null) {
+ providerWires = new ArrayList<ModuleWire>();
+ toRemoveWireLists.put(wire.getProviderWiring(), providerWires);
+ }
+ providerWires.add(wire);
+ }
+ }
for (ModuleRevision pendingRemoval : dependencyClosure) {
pendingRemoval.getRevisions().removeRevision(pendingRemoval);
removeCapabilities(pendingRemoval);
wirings.remove(pendingRemoval);
}
+ // remove any wires from unresolved wirings that got removed
+ for (Map.Entry<ModuleWiring, Collection<ModuleWire>> entry : toRemoveWireLists.entrySet()) {
+ List<ModuleWire> provided = entry.getKey().getProvidedModuleWires(null);
+ provided.removeAll(entry.getValue());
+ entry.getKey().setProvidedWires(provided);
+ for (ModuleWire removedWire : entry.getValue()) {
+ // invalidate the wire
+ removedWire.invalidate();
+ }
+ }
}
}
}

Back to the top