Bug 89550 [Undo] - beef up javadoc for event notification and dispose
I20050330-0500 This is maybe a problem in the commands plugin - if so, please move the bug up. - Have compilation unit p/A.java: ----------------------- package p; public class B { } ----------------------- - Change "B" to "A" - Edit > Undo Typing - Ctrl+1, choose "Rename compilation unit to 'B.java'" => The following exception is written to the console (but not to the log): java.lang.NullPointerException at org.eclipse.jface.text.DefaultUndoManager$TextCommand.canRedo(DefaultUndoManager.java:166) at org.eclipse.core.commands.operations.DefaultOperationHistory.canRedo(DefaultOperationHistory.java:183) at org.eclipse.ui.operations.RedoActionHandler.shouldBeEnabled(RedoActionHandler.java:72) at org.eclipse.ui.operations.OperationHistoryActionHandler.update(OperationHistoryActionHandler.java:258) at org.eclipse.ui.operations.OperationHistoryActionHandler.historyNotification(OperationHistoryActionHandler.java:243) at org.eclipse.core.commands.operations.DefaultOperationHistory.notifyRemoved(DefaultOperationHistory.java:925) at org.eclipse.core.commands.operations.DefaultOperationHistory.internalRemove(DefaultOperationHistory.java:750) at org.eclipse.core.commands.operations.DefaultOperationHistory.flushUndo(DefaultOperationHistory.java:547) at org.eclipse.core.commands.operations.DefaultOperationHistory.dispose(DefaultOperationHistory.java:253) at org.eclipse.jface.text.DefaultUndoManager.disposeCommandStack(DefaultUndoManager.java:882) at org.eclipse.jface.text.DefaultUndoManager.disconnect(DefaultUndoManager.java:1165) at org.eclipse.jface.text.source.SourceViewer.unconfigure(SourceViewer.java:554) at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.unconfigure(JavaSourceViewer.java:329) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.unconfigure(CompilationUnitEditor.java:228) at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSetInput(JavaEditor.java:2224) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSetInput(CompilationUnitEditor.java:1500) at org.eclipse.ui.texteditor.AbstractTextEditor.setInput(AbstractTextEditor.java:3019) at org.eclipse.ui.texteditor.AbstractTextEditor$7.run(AbstractTextEditor.java:402) at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.execute(AbstractTextEditor.java:459) at org.eclipse.ui.texteditor.AbstractTextEditor$ElementStateListener.elementMoved(AbstractTextEditor.java:420) at org.eclipse.ui.editors.text.TextFileDocumentProvider$FileBufferListener.underlyingFileMoved(TextFileDocumentProvider.java:305) at org.eclipse.core.internal.filebuffers.TextFileBufferManager$6.run(TextFileBufferManager.java:390) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1021) at org.eclipse.core.runtime.Platform.run(Platform.java:757) at org.eclipse.core.internal.filebuffers.TextFileBufferManager.fireUnderlyingFileMoved(TextFileBufferManager.java:388) at org.eclipse.core.internal.filebuffers.ResourceFileBuffer.handleFileMoved(ResourceFileBuffer.java:431) at org.eclipse.core.internal.filebuffers.ResourceFileBuffer$3.execute(ResourceFileBuffer.java:153) at org.eclipse.core.internal.filebuffers.ResourceFileBuffer$SafeFileChange.run(ResourceFileBuffer.java:78) at org.eclipse.ui.internal.editors.text.UISynchronizationContext.run(UISynchronizationContext.java:34) at org.eclipse.core.internal.filebuffers.TextFileBufferManager.execute(TextFileBufferManager.java:334) at org.eclipse.core.internal.filebuffers.ResourceFileBuffer$FileSynchronizer.resourceChanged(ResourceFileBuffer.java:170) at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:276) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1021) at org.eclipse.core.runtime.Platform.run(Platform.java:757) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:270) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:144) at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:180) at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:912) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1723) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:771) at org.eclipse.jdt.internal.core.JavaModel.rename(JavaModel.java:303) at org.eclipse.jdt.internal.core.CompilationUnit.rename(CompilationUnit.java:1102) at org.eclipse.jdt.internal.corext.refactoring.changes.RenameCompilationUnitChange.doRename(RenameCompilationUnitChange.java:67) at org.eclipse.jdt.internal.corext.refactoring.AbstractJavaElementRenameChange.perform(AbstractJavaElementRenameChange.java:72) at org.eclipse.jdt.internal.ui.text.correction.ChangeCorrectionProposal.performChange(ChangeCorrectionProposal.java:109) at org.eclipse.jdt.internal.ui.text.correction.ChangeCorrectionProposal.apply(ChangeCorrectionProposal.java:72) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:425) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.selectProposalWithMask(CompletionProposalPopup.java:367) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$19(CompletionProposalPopup.java:363) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$3.widgetDefaultSelected(CompletionProposalPopup.java:328) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:96) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2894) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2527) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:338) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:151) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:268) at org.eclipse.core.launcher.Main.basicRun(Main.java:260) at org.eclipse.core.launcher.Main.run(Main.java:887) at org.eclipse.core.launcher.Main.main(Main.java:871)
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/IOperationHistory.java
* severity indicates that the undo operation was successful and that the
	 * operation has been placed on the redo history. Listeners will receive the
	 * <code>UNDONE</code> notification.
	 * 
	 * <code>CANCEL</code> severity indicates that the user cancelled the
	 * operation and that the operation remains in the undo history.
	 * <code>ERROR</code> severity indicates that the operation could not
	 * successfully be undone and that it has been removed from the history.
	 * Listeners will be notified that the operation was removed. Any other
	 * severity code is not interpreted by the history, and is simply passed
	 * back to the caller. For all severities other than <code>OK</code>,
	 * listeners will receive the <code>OPERATION_NOT_OK</code> notification
	 * instead of the <code>UNDONE</code> notification.
	 * 
	 * @throws ExecutionException
	 *             if an exception occurred during undo.
	 */
	IStatus undo(IUndoContext context, IProgressMonitor monitor, IAdaptable info)
			throws ExecutionException;
	/**
	 * Undo the specified operation
	 * 
	 * @param operation -
	 *            the operation to be undone
	 * @param monitor -
	 *            the progress monitor to be used for the undo, or
	 *            <code>null</code> if no progress monitor is provided
	 * @param info -
	 *            the IAdaptable (or <code>null</code>) provided by the
	 *            caller in order to supply UI information for prompting the