Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2016-01-20 11:31:26 -0500
committerMarkus Keller2016-01-20 11:31:26 -0500
commit0bea9726df0c7a51257165226de61c26c7798c58 (patch)
treefb4279ef99b308b6686d12680d57db0d5a0f3925 /org.eclipse.text/src/org/eclipse/text/undo
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.text/src/org/eclipse/text/undo')
-rw-r--r--org.eclipse.text/src/org/eclipse/text/undo/DocumentUndoManager.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/org.eclipse.text/src/org/eclipse/text/undo/DocumentUndoManager.java b/org.eclipse.text/src/org/eclipse/text/undo/DocumentUndoManager.java
index 4ead31215..aef594799 100644
--- a/org.eclipse.text/src/org/eclipse/text/undo/DocumentUndoManager.java
+++ b/org.eclipse.text/src/org/eclipse/text/undo/DocumentUndoManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 IBM Corporation and others.
+ * Copyright (c) 2006, 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
@@ -735,7 +735,7 @@ public class DocumentUndoManager implements IDocumentUndoManager {
private boolean fOverwriting= false;
/** The registered document listeners. */
- private ListenerList fDocumentUndoListeners;
+ private ListenerList<IDocumentUndoListener> fDocumentUndoListeners;
/** The list of clients connected. */
private List<Object> fConnected;
@@ -753,7 +753,7 @@ public class DocumentUndoManager implements IDocumentUndoManager {
fHistory= OperationHistoryFactory.getOperationHistory();
fUndoContext= new ObjectUndoContext(fDocument);
fConnected= new ArrayList<>();
- fDocumentUndoListeners= new ListenerList(ListenerList.IDENTITY);
+ fDocumentUndoListeners= new ListenerList<>(ListenerList.IDENTITY);
}
@Override
@@ -873,9 +873,8 @@ public class DocumentUndoManager implements IDocumentUndoManager {
void fireDocumentUndo(int offset, String text, String preservedText, Object source, int eventType, boolean isCompound) {
eventType= isCompound ? eventType | DocumentUndoEvent.COMPOUND : eventType;
DocumentUndoEvent event= new DocumentUndoEvent(fDocument, offset, text, preservedText, eventType, source);
- Object[] listeners= fDocumentUndoListeners.getListeners();
- for (int i= 0; i < listeners.length; i++) {
- ((IDocumentUndoListener)listeners[i]).documentUndoNotification(event);
+ for (IDocumentUndoListener listener : fDocumentUndoListeners) {
+ listener.documentUndoNotification(event);
}
}

Back to the top