Bug 161786 [Undo] - operations with multiple, matching contexts not disposed properly
Found this problem running the workspace operations automated tests. In that suite, a marker operation that changes a bookmark and a task is performed. The operation is therefore assigned two undo contexts "bookmark" and "task". These two undo contexts are set up to "match" against the workspace context. This is done so that only task ops show up in the task list undo history, only bookmark ops show up in the bookmark view undo history, but all of the marker ops show up in the workspace undo history. The problem occurs when I attempt to dispose the workspace context. In theory, this marker operation should be disposed, since both contexts match the workspace context. In practice it doesn't happen and I get this operation "stuck" in the undo history.
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/DefaultOperationHistory.java
* disposed. This flag should be used for debug purposes only.
	 */
	public static boolean DEBUG_OPERATION_HISTORY_DISPOSE = false;
	/**
	 * This flag can be set to <code>true</code> if the history should print
	 * information to <code>System.out</code> during the open/close sequence.
	 * This flag should be used for debug purposes only.
	 */
	public static boolean DEBUG_OPERATION_HISTORY_OPENOPERATION = false;
	/**
	 * This flag can be set to <code>true</code> if the history should print
	 * information to <code>System.out</code> whenever an operation is not
	 * approved. This flag should be used for debug purposes only.
	 */
	public static boolean DEBUG_OPERATION_HISTORY_APPROVAL = false;
	static final int DEFAULT_LIMIT = 20;
	/**
	 * the list of {@link IOperationApprover}s
	 */
	ListenerList approvers = new ListenerList(ListenerList.IDENTITY);
	/**
	 * a map of undo limits per context
	 */
	private Map limits = Collections.synchronizedMap(new HashMap());
	/**
	 * the list of {@link IOperationHistoryListener}s
	 */
	ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
	/**
	 * the list of operations available for redo, LIFO