Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2006-11-01 15:38:10 -0500
committerThomas Watson2006-11-01 15:38:10 -0500
commitac8b7b17f637f3eb1e7cf670fe8e93dc5bdcafed (patch)
tree6478eb15c398930d552e016b5c6c3141db2ae528
parent1dfc42627cce04a32ec5de6f311cb521336cb27d (diff)
downloadrt.equinox.framework-ac8b7b17f637f3eb1e7cf670fe8e93dc5bdcafed.tar.gz
rt.equinox.framework-ac8b7b17f637f3eb1e7cf670fe8e93dc5bdcafed.tar.xz
rt.equinox.framework-ac8b7b17f637f3eb1e7cf670fe8e93dc5bdcafed.zip
Bug 162935 BundleDescription leak in UserState
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/UserState.java31
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);

Back to the top