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
* be properly synchronized using the techniques specified by the client's
 * widget library.
 * </p>
 * 
 * <p>
 * This implementation is not intended to be subclassed.
 * </p>
 * 
 * @see org.eclipse.core.commands.operations.IOperationHistory
 * @see org.eclipse.core.commands.operations.IOperationApprover
 * 
 * @since 3.1
 */
public final class DefaultOperationHistory implements IOperationHistory {
	/**
	 * This flag can be set to <code>true</code> if the history should print
	 * information to <code>System.out</code> whenever notifications about
	 * changes to the history occur. This flag should be used for debug purposes
	 * only.
	 */
	public static boolean DEBUG_OPERATION_HISTORY_NOTIFICATION = false;
	/**
	 * This flag can be set to <code>true</code> if the history should print
	 * information to <code>System.out</code> whenever an unexpected condition
	 * arises. This flag should be used for debug purposes only.
	 */
	public static boolean DEBUG_OPERATION_HISTORY_UNEXPECTED = false;
	/**
	 * This flag can be set to <code>true</code> if the history should print
	 * information to <code>System.out</code> whenever an undo context is