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
}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.core.commands.operations.IOperationHistory#getUndoOperation(org.eclipse.core.commands.operations.IUndoContext)
	 */
	public IUndoableOperation getUndoOperation(IUndoContext context) {
		Assert.isNotNull(context);
		synchronized (undoRedoHistoryLock) {
			for (int i = undoList.size() - 1; i >= 0; i--) {
				IUndoableOperation operation = (IUndoableOperation) undoList
						.get(i);
				if (operation.hasContext(context)) {
					return operation;
				}
			}
		}
		return null;
	}
	/*
	 * Consult the IOperationApprovers to see if the proposed execution should
	 * be allowed.
	 * 
	 * @since 3.2
	 */
	private IStatus getExecuteApproval(IUndoableOperation operation,
			IAdaptable info) {
		final Object[] approverArray = approvers.getListeners();
		for (int i = 0; i < approverArray.length; i++) {
			if (approverArray[i] instanceof IOperationApprover2) {