Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2011-07-26 18:15:54 +0000
committerThomas Watson2011-07-26 18:15:54 +0000
commitf2bb8d0b941fc6c3b9c2c43f1df73ebd2f3048ca (patch)
treedaffd7ea227df1853367318ab56083ed6eb1a883 /bundles/org.eclipse.osgi/resolver
parent25adc962ef117d879d9ca5713a8f64af2af4834a (diff)
downloadrt.equinox.framework-f2bb8d0b941fc6c3b9c2c43f1df73ebd2f3048ca.tar.gz
rt.equinox.framework-f2bb8d0b941fc6c3b9c2c43f1df73ebd2f3048ca.tar.xz
rt.equinox.framework-f2bb8d0b941fc6c3b9c2c43f1df73ebd2f3048ca.zip
Bug 353103 - ConcurrentModificationException during resolver fragment processing
Diffstat (limited to 'bundles/org.eclipse.osgi/resolver')
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverBundle.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverBundle.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverBundle.java
index dfb102ccd..41c0faf96 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverBundle.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverBundle.java
@@ -499,7 +499,9 @@ public class ResolverBundle extends VersionSupplier implements Comparable<Resolv
// the fragment is being detached because one of its imports or requires cannot be resolved;
// we need to check the remaining fragment constraints to make sure they do not have
// the same unresolved constraint.
- for (ResolverBundle remainingFrag : fragments) {
+ // bug 353103: must make a snapshot to avoid ConcurrentModificationException
+ ResolverBundle[] remainingFrags = fragments.toArray(new ResolverBundle[fragments.size()]);
+ for (ResolverBundle remainingFrag : remainingFrags) {
List<ResolverImport> additionalImports = new ArrayList<ResolverImport>(0);
List<BundleConstraint> additionalRequires = new ArrayList<BundleConstraint>(0);
if (hasUnresolvedConstraint(reason, fragment, remainingFrag, oldImports, oldRequires, additionalImports, additionalRequires))
@@ -540,7 +542,7 @@ public class ResolverBundle extends VersionSupplier implements Comparable<Resolv
constraints = remainingFragRequires;
for (int i = 0; i < constraints.length; i++)
if (reason.getName().equals(constraints[i].getName())) {
- detachFragment(remainingFragment, null);
+ detachFragment(remainingFragment, reason);
return true;
}
for (int i = 0; i < oldImports.length; i++) {

Back to the top