Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-10-12 03:52:12 +0000
committerPawel Piech2012-10-12 04:08:46 +0000
commitb55a4bb203803a86d0792de5f9f17103c6cc09a0 (patch)
tree70208e6dfc941bdcfd8d7e370043ea6a7acb679d
parenta68f972007c011994af90bf8a7a9f1b81616f306 (diff)
downloadeclipse.platform.debug-b55a4bb203803a86d0792de5f9f17103c6cc09a0.tar.gz
eclipse.platform.debug-b55a4bb203803a86d0792de5f9f17103c6cc09a0.tar.xz
eclipse.platform.debug-b55a4bb203803a86d0792de5f9f17103c6cc09a0.zip
Bug 391667 - ConcurrentModificationException installing model proxies
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java34
1 files changed, 18 insertions, 16 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
index 0d6908bfd..aeead571a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
@@ -129,24 +129,26 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunch[] allLaunches = manager.getLaunches();
ModelDelta root = new ModelDelta(manager, 0, IModelDelta.NO_CHANGE, allLaunches.length);
- Object[] children = fLaunch.getChildren();
- ModelDelta launchDelta = root.addNode(fLaunch, indexOf(fLaunch, allLaunches), IModelDelta.EXPAND, children.length);
- for (int j = 0; j < children.length; j++) {
- Object child = children[j];
- if (fPrevChildren.add(child)) {
- changes = true;
- launchDelta.addNode(child, indexOf(child, children), IModelDelta.INSTALL, -1);
+ synchronized(this) {
+ Object[] children = fLaunch.getChildren();
+ ModelDelta launchDelta = root.addNode(fLaunch, indexOf(fLaunch, allLaunches), IModelDelta.EXPAND, children.length);
+ for (int j = 0; j < children.length; j++) {
+ Object child = children[j];
+ if (fPrevChildren.add(child)) {
+ changes = true;
+ launchDelta.addNode(child, indexOf(child, children), IModelDelta.INSTALL, -1);
+ }
}
+ List childrenList = Arrays.asList(children);
+ for (Iterator itr = fPrevChildren.iterator(); itr.hasNext();) {
+ Object child = itr.next();
+ if (!childrenList.contains(child)) {
+ itr.remove();
+ changes = true;
+ launchDelta.addNode(child, IModelDelta.UNINSTALL);
+ }
+ }
}
- List childrenList = Arrays.asList(children);
- for (Iterator itr = fPrevChildren.iterator(); itr.hasNext();) {
- Object child = itr.next();
- if (!childrenList.contains(child)) {
- itr.remove();
- changes = true;
- launchDelta.addNode(child, IModelDelta.UNINSTALL);
- }
- }
if (changes) {
fireModelChanged(root);
}

Back to the top