Bug 72024 UndoManager creates potential memory leak [refactoring]
3.0 The refactoring undo manager doesn't call dispose in all cases where a undo/redo object is no longer needed. This can result in a memory leak since the undo/redo object could register for listeners and therefore relies on the fact the dispose is called correctly. Cases where dispose isn't called: - if the undo stack reaches it maximum number of change objects and the last one is removed from the stack. - if the undo/redo stack gests flushed and one of the change objects causes an exception during sending dispose. - if the undo/redo object isn't valid anymore and can therefore not be executed.
org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/UndoManager.java
final boolean[] interrupted= new boolean[1];
		IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
			public void run(IProgressMonitor monitor) throws CoreException {
				boolean undoInitialized= false;
				try {
					monitor.beginTask("", 11); 
					status.merge(change.isValid(new SubProgressMonitor(monitor, 2)));
					if (status.hasFatalError()) {
						query.stopped(status);
						return;
					}
					if (!status.isOK() && !query.proceed(status)) {
						interrupted[0]= true;
						return;
					}
					ResourcesPlugin.getWorkspace().checkpoint(false);
					aboutToPerformChange(change);
					
					undo[0]= change.perform(new SubProgressMonitor(monitor, 8));
					
					ResourcesPlugin.getWorkspace().checkpoint(false);
					changePerformed(change);
					change.dispose();
					if (undo[0] != null) {
						undo[0].initializeValidationData(new SubProgressMonitor(monitor, 1));
						undoInitialized= true;
					}
				} catch (CoreException e) {
					flush();
					if (undo[0] != null && undoInitialized) {