Bug 323444 [Undo] [Commands] java.util.ConcurrentModificationException when trying to get the undo history from a source viewer
I got the following exception once when attempting to get the undo history from a source viewer in my code. Looking at the implementation of this method, I cannot seem to see how this could occur since all access to this list in DefaultOperationHistory are synchronized. Maybe it is the creation of the iterator outside of the synchronized block? Note that I have been unable to reproduce this since I first saw it since it seems to be a rare race condition. Exception Stack Trace: java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at java.util.AbstractList$Itr.next(AbstractList.java:343) at org.eclipse.core.commands.operations.DefaultOperationHistory.filter(DefaultOperationHistory.java:558) at org.eclipse.core.commands.operations.DefaultOperationHistory.getUndoHistory(DefaultOperationHistory.java:843)
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/DefaultOperationHistory.java
* the list of {@link IOperationHistoryListener}s
	 */
	ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
	/**
	 * the list of operations available for redo, LIFO
	 */
	private List redoList = Collections.synchronizedList(new ArrayList());
	/**
	 * the list of operations available for undo, LIFO
	 */
	private List undoList = Collections.synchronizedList(new ArrayList());
	/**
	 * a lock that is used to synchronize access between the undo and redo
	 * history
	 */
	final Object undoRedoHistoryLock = new Object();
	/**
	 * An operation that is "absorbing" all other operations while it is open.
	 * When this is not null, other operations added or executed are added to
	 * this composite.
	 * 
	 */
	private ICompositeOperation openComposite = null;
	/**
	 * a lock that is used to synchronize access to the open composite.
	 */
	final Object openCompositeLock = new Object();
	/**
	 * Create an instance of DefaultOperationHistory.
	 */