summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDean Roberts2011-11-08 13:52:00 (EST)
committer Paul Webster2011-11-08 13:52:00 (EST)
commit0d6a529a609385ff6eb96ee5e40b51e828308659 (patch)
tree14655c72adc4d698309169917b48fd261ba14337
parent4cf77281d87a268a9e2963d94c740f33e8bb6b34 (diff)
downloadeclipse.platform.ui-0d6a529a609385ff6eb96ee5e40b51e828308659.zip
eclipse.platform.ui-0d6a529a609385ff6eb96ee5e40b51e828308659.tar.gz
eclipse.platform.ui-0d6a529a609385ff6eb96ee5e40b51e828308659.tar.bz2
Bug 361360 - CME in PageSite.activatev20111108-1852
switched to a copy of the array before iterating
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/NestableHandlerService.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/NestableHandlerService.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/NestableHandlerService.java
index 4576a75..7558f52 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/NestableHandlerService.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/NestableHandlerService.java
@@ -11,8 +11,6 @@
package org.eclipse.ui.internal.handlers;
-import java.util.Iterator;
-
import org.eclipse.core.expressions.Expression;
import org.eclipse.ui.handlers.IHandlerActivation;
import org.eclipse.ui.handlers.IHandlerService;
@@ -61,16 +59,17 @@ public final class NestableHandlerService extends SlaveHandlerService implements
return;
}
- final Iterator localActivationItr = localActivationsToParentActivations
- .keySet().iterator();
- while (localActivationItr.hasNext()) {
- final Object object = localActivationItr.next();
+ Object[] localActivations = localActivationsToParentActivations.keySet().toArray();
+ for (int i = 0; i < localActivations.length; i++) {
+ final Object object = localActivations[i];
if (object instanceof IHandlerActivation) {
final IHandlerActivation localActivation = (IHandlerActivation) object;
- super.doActivation(localActivation);
+ // Ignore activations that have been cleared since the copy
+ // was made.
+ if (localActivationsToParentActivations.containsKey(localActivation))
+ super.doActivation(localActivation);
}
}
-
active = true;
}
@@ -91,11 +90,11 @@ public final class NestableHandlerService extends SlaveHandlerService implements
deactivateHandlers(parentActivations);
parentActivations.clear();
- final Iterator localActivationItr = localActivationsToParentActivations
- .keySet().iterator();
- while (localActivationItr.hasNext()) {
- final Object object = localActivationItr.next();
- localActivationsToParentActivations.put(object, null);
+ Object[] localActivations = localActivationsToParentActivations.keySet().toArray();
+ for (int i = 0; i < localActivations.length; i++) {
+ final Object object = localActivations[i];
+ if (localActivationsToParentActivations.containsKey(object))
+ localActivationsToParentActivations.put(object, null);
}
active = false;