Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2009-09-01 15:55:55 -0400
committerThomas Watson2009-09-01 15:55:55 -0400
commit749eca7bcbda579d405081b25da9c38cf6c96ed8 (patch)
tree5efd1a6233956f89a6167ac12132f8229936145b /bundles/org.eclipse.osgi/resolver
parent23ffb49b4a8418c17219662da0774952eb18a2ef (diff)
downloadrt.equinox.framework-749eca7bcbda579d405081b25da9c38cf6c96ed8.tar.gz
rt.equinox.framework-749eca7bcbda579d405081b25da9c38cf6c96ed8.tar.xz
rt.equinox.framework-749eca7bcbda579d405081b25da9c38cf6c96ed8.zip
Bug 287636 - PackageAdmin#getExportedPackages() returns wrong info
Diffstat (limited to 'bundles/org.eclipse.osgi/resolver')
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
index b64c0270d..327c2581c 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java
@@ -805,9 +805,19 @@ public abstract class StateImpl implements State {
return symbolicName != null ? symbolicName : Constants.getInternalSymbolicName();
}
+ /**
+ * Returns the latest versions BundleDescriptions which have old removal pending versions.
+ * @return the BundleDescriptions that have removal pending versions.
+ */
public BundleDescription[] getRemovalPendings() {
synchronized (this.monitor) {
- return (BundleDescription[]) removalPendings.toArray(new BundleDescription[removalPendings.size()]);
+ Iterator removed = removalPendings.iterator();
+ BundleDescription[] result = new BundleDescription[removalPendings.size()];
+ int i = 0;
+ while (removed.hasNext())
+ // we return the latest version of the description if it is still contained in the state (bug 287636)
+ result[i++] = getBundle(((BundleDescription) removed.next()).getBundleId());
+ return result;
}
}

Back to the top