aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Roberts2011-10-11 14:38:25 (EDT)
committerRemy Suen2011-10-11 14:46:47 (EDT)
commit4817a6c60e809af09bfa750b509648c6433f95d2 (patch)
tree02ea53c7ba65abcdeec35dbbcb9ac41ae257399d
parent6ab89bba030ab5dd4aa52c35cc3720a2156bafcc (diff)
downloadeclipse.platform.ui-4817a6c60e809af09bfa750b509648c6433f95d2.zip
eclipse.platform.ui-4817a6c60e809af09bfa750b509648c6433f95d2.tar.gz
eclipse.platform.ui-4817a6c60e809af09bfa750b509648c6433f95d2.tar.bz2
Bug 359887 Removing IIdentifierListener corrupts changed event list
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
index 69d2c00..239f0db 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/activities/Identifier.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,12 +11,10 @@
package org.eclipse.ui.internal.activities;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
-
+import org.eclipse.core.runtime.ListenerList;
import org.eclipse.ui.activities.IIdentifier;
import org.eclipse.ui.activities.IIdentifierListener;
import org.eclipse.ui.activities.IdentifierEvent;
@@ -40,7 +38,7 @@ final class Identifier implements IIdentifier {
private String id;
- private List identifierListeners;
+ private ListenerList identifierListeners;
private transient String string;
@@ -58,13 +56,10 @@ final class Identifier implements IIdentifier {
}
if (identifierListeners == null) {
- identifierListeners = new ArrayList();
- }
-
- if (!identifierListeners.contains(identifierListener)) {
- identifierListeners.add(identifierListener);
+ identifierListeners = new ListenerList();
}
+ identifierListeners.add(identifierListener);
strongReferences.add(this);
}
@@ -107,9 +102,10 @@ final class Identifier implements IIdentifier {
}
if (identifierListeners != null) {
- for (int i = 0; i < identifierListeners.size(); i++) {
- ((IIdentifierListener) identifierListeners.get(i))
- .identifierChanged(identifierEvent);
+ Object[] listeners = identifierListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ Object listener = listeners[i];
+ ((IIdentifierListener) listener).identifierChanged(identifierEvent);
}
}
}