diff options
author | Kim Tsao | 2015-05-26 19:44:25 +0000 |
---|---|---|
committer | Roberto Sanchez | 2015-05-26 19:44:25 +0000 |
commit | c995653b511829fc86956d5e78c4cc47c4b8d5bf (patch) | |
tree | 524aab945a8b3181157648474d86cf50cd83cab4 | |
parent | ceffcada5e0bee378cde3f16291f6ea29697ca20 (diff) | |
download | webtools.javaee-c995653b511829fc86956d5e78c4cc47c4b8d5bf.tar.gz webtools.javaee-c995653b511829fc86956d5e78c4cc47c4b8d5bf.tar.xz webtools.javaee-c995653b511829fc86956d5e78c4cc47c4b8d5bf.zip |
[468178] ConcurrentModificationException while editing a java file with EAR deployed on a server
-rw-r--r-- | plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/SingleRootExportParticipant.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/SingleRootExportParticipant.java b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/SingleRootExportParticipant.java index ded56478f..a563e44e6 100644 --- a/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/SingleRootExportParticipant.java +++ b/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/SingleRootExportParticipant.java @@ -14,6 +14,7 @@ package org.eclipse.jst.common.internal.modulecore; import java.io.File; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -95,7 +96,7 @@ public class SingleRootExportParticipant extends AbstractFlattenParticipant { try { resources.clear(); // We want complete control childModules.clear(); - children = childModules; + children = Collections.synchronizedList(childModules); initializeDelegates(); IContainer container = new SingleRootUtil(component, callbackHandler).getSingleRoot(); @@ -196,12 +197,14 @@ public class SingleRootExportParticipant extends AbstractFlattenParticipant { if (isChildModule(vc, reference)) { ChildModuleReference cm = new ChildModuleReference(reference, new Path("")); //$NON-NLS-1$ List<IChildModuleReference> duplicates = new ArrayList(); - for (IChildModuleReference tmp : children) { - if (tmp.getRelativeURI().equals(cm.getRelativeURI())) - duplicates.add(tmp); + synchronized(children){ + for (IChildModuleReference tmp : children) { + if (tmp.getRelativeURI().equals(cm.getRelativeURI())) + duplicates.add(tmp); + } + children.removeAll(duplicates); + children.add(cm); } - children.removeAll(duplicates); - children.add(cm); } else { // It's not a child module, but it is a reference that needs to be added in anyway refAsResource.add(reference); |