summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDean Roberts2011-11-08 13:52:00 (EST)
committer Paul Webster2011-11-08 14:29:46 (EST)
commit38fcec61b72262842cf6bdfeda12c99247c72377 (patch)
tree7d7276e5de342fdd6e7056fdeb6c8b82dc3424a8
parentb24ba5418fc852ee518e5aad66e8e0bc93469a6c (diff)
downloadeclipse.platform.ui-38fcec61b72262842cf6bdfeda12c99247c72377.zip
eclipse.platform.ui-38fcec61b72262842cf6bdfeda12c99247c72377.tar.gz
eclipse.platform.ui-38fcec61b72262842cf6bdfeda12c99247c72377.tar.bz2
Bug 361360 - CME in PageSite.activatev20111108-1929
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;