Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2016-01-20 16:31:26 +0000
committerMarkus Keller2016-01-20 16:31:26 +0000
commit0bea9726df0c7a51257165226de61c26c7798c58 (patch)
treefb4279ef99b308b6686d12680d57db0d5a0f3925 /org.eclipse.ui.editors
parentb45e6c163c5f101d2bdb8248593972e2a6cc6eb5 (diff)
downloadeclipse.platform.text-0bea9726df0c7a51257165226de61c26c7798c58.tar.gz
eclipse.platform.text-0bea9726df0c7a51257165226de61c26c7798c58.tar.xz
eclipse.platform.text-0bea9726df0c7a51257165226de61c26c7798c58.zip
Fixes for bug 483340: ListenerList should be parameterized
Diffstat (limited to 'org.eclipse.ui.editors')
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesBlock.java8
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChainedPreferenceStore.java10
2 files changed, 8 insertions, 10 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesBlock.java
index 8f3b8cf84..b44c54bbd 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesBlock.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesBlock.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -88,7 +88,7 @@ class SelectResourcesBlock implements ICheckStateListener, ISelectionChangedList
private Collection<Object> whiteCheckedTreeItems= new HashSet<>();
- private ListenerList listeners= new ListenerList(ListenerList.IDENTITY);
+ private ListenerList<ICheckStateListener> listeners= new ListenerList<>(ListenerList.IDENTITY);
private ITreeContentProvider treeContentProvider;
@@ -564,9 +564,7 @@ class SelectResourcesBlock implements ICheckStateListener, ISelectionChangedList
* @param event the event
*/
private void notifyCheckStateChangeListeners(final CheckStateChangedEvent event) {
- Object[] array= listeners.getListeners();
- for (int i= 0; i < array.length; i++) {
- final ICheckStateListener l= (ICheckStateListener) array[i];
+ for (ICheckStateListener l : listeners) {
SafeRunner.run(new SafeRunnable() {
@Override
public void run() {
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChainedPreferenceStore.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChainedPreferenceStore.java
index 6705e52f0..7f4e30cd2 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChainedPreferenceStore.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChainedPreferenceStore.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -38,7 +38,7 @@ public class ChainedPreferenceStore implements IPreferenceStore {
private IPreferenceStore[] fPreferenceStores;
/** Listeners on this chained preference store. */
- private ListenerList fClientListeners= new ListenerList(ListenerList.IDENTITY);
+ private ListenerList<IPropertyChangeListener> fClientListeners= new ListenerList<>(ListenerList.IDENTITY);
/** Listeners on the child preference stores. */
private List<PropertyChangeListener> fChildListeners= new ArrayList<>();
@@ -149,9 +149,9 @@ public class ChainedPreferenceStore implements IPreferenceStore {
* @param event the property change event
*/
private void firePropertyChangeEvent(PropertyChangeEvent event) {
- Object[] listeners= fClientListeners.getListeners();
- for (int i= 0; i < listeners.length; i++)
- ((IPropertyChangeListener) listeners[i]).propertyChange(event);
+ for (IPropertyChangeListener listener : fClientListeners) {
+ listener.propertyChange(event);
+ }
}
@Override

Back to the top