diff options
-rw-r--r-- | bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/UserState.java | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/UserState.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/UserState.java index 6018d7d17..1bf7d4be8 100644 --- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/UserState.java +++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/UserState.java @@ -10,8 +10,8 @@ *******************************************************************************/ package org.eclipse.osgi.internal.resolver; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; +import java.util.Set; import org.eclipse.osgi.service.resolver.*; import org.osgi.framework.BundleException; @@ -19,21 +19,14 @@ import org.osgi.framework.BundleException; * This implementation of State does a bookkeeping of all added/removed */ public class UserState extends StateImpl { - private List added = new ArrayList(); - private List removed = new ArrayList(); - private List updated = new ArrayList(); - - public synchronized boolean addBundle(BundleDescription description) { - if (!super.addBundle(description)) - return false; - added.add(description.getLocation()); - return true; - } + // TODO this is not an accurate way to record updates + private Set updated = new HashSet(); public synchronized boolean removeBundle(BundleDescription description) { + if (description.getLocation() != null) + updated.remove(description.getLocation()); if (!super.removeBundle(description)) return false; - removed.add(description.getLocation()); return true; } @@ -44,18 +37,6 @@ public class UserState extends StateImpl { return true; } - public String[] getAllAdded() { - return (String[]) added.toArray(new String[added.size()]); - } - - public String[] getAllRemoved() { - return (String[]) removed.toArray(new String[removed.size()]); - } - - public String[] getAllUpdated() { - return (String[]) updated.toArray(new String[updated.size()]); - } - public StateDelta compare(State baseState) throws BundleException { BundleDescription[] current = this.getBundles(); StateDeltaImpl delta = new StateDeltaImpl(this); |