Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2019-06-27 15:35:27 -0400
committerThomas Watson2019-06-27 15:35:27 -0400
commit68ef33a10da1674e02fe5975ab27c613c5372f77 (patch)
treedbe659e3da373ef696d30f181fd3b057e16e3f41
parentdd5045f0d79e3c8001a0b7abab6733f89d385d1b (diff)
downloadrt.equinox.framework-68ef33a10da1674e02fe5975ab27c613c5372f77.tar.gz
rt.equinox.framework-68ef33a10da1674e02fe5975ab27c613c5372f77.tar.xz
rt.equinox.framework-68ef33a10da1674e02fe5975ab27c613c5372f77.zip
Bug 548727 - Using Collection.removeAll is not always the best
Change-Id: I71c48a74d00a3a57c9f838f22a4f6cfdd3a27f01 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java
index c48483a2e..c55afa11e 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleResolver.java
@@ -606,7 +606,9 @@ final class ModuleResolver {
this.optionals = new LinkedHashSet<>(unresolved);
if (this.triggersMandatory) {
// do this the hard way because the 'optimization' in removeAll hurts us
- this.optionals.removeAll(triggers);
+ for (ModuleRevision triggerRevision : triggers) {
+ this.optionals.remove(triggerRevision);
+ }
}
this.wirings = new HashMap<>(wirings);
this.previouslyResolved = new HashSet<>(wirings.keySet());
@@ -1404,7 +1406,9 @@ final class ModuleResolver {
Collection<ModuleRevision> enabledCandidates = new ArrayList<>(unresolved);
hook.filterResolvable(InternalUtils.asListBundleRevision((List<? extends BundleRevision>) enabledCandidates));
// do this the hard way because the 'optimization' in removeAll hurts us
- disabled.removeAll(enabledCandidates);
+ for (ModuleRevision enabledRevision : enabledCandidates) {
+ disabled.remove(enabledRevision);
+ }
for (ModuleRevision revision : disabled) {
reportBuilder.addEntry(revision, Entry.Type.FILTERED_BY_RESOLVER_HOOK, null);
if (DEBUG_HOOKS) {

Back to the top