Project: JDT
Bug 157798 [clean up] NPE in preview
Reported: 2006-09-19 09:04:48 | Status: resolved fixed

20060919 - create the folloing two CUs package a; public class B{ void foo() { if (true) return; } } ----- package a; public class A { } - select the two CUs and invoke 'Clean Up' - on the wizard page, click on the 'Configure Clean Ups' link and create a new profile based on the built-in but with 'Convert control statement bodies to block' and 'Code formatting enabled' - press next. On the preview page expand the node for B/java and click on the type node !ENTRY org.eclipse.ltk.core.refactoring 4 10000 2006-09-19 14:49:21.569 !MESSAGE Could not find the original of the copied text edit {ReplaceEdit} [2296,0] << !ENTRY org.eclipse.ltk.core.refactoring 4 10000 2006-09-19 14:49:21.569 !MESSAGE Could not find the original of the copied text edit {ReplaceEdit} [2139,3] << !ENTRY org.eclipse.ltk.core.refactoring 4 10000 2006-09-19 14:49:21.569 !MESSAGE Could not find the original of the copied text edit {ReplaceEdit} [2103,0] << !ENTRY org.eclipse.ltk.core.refactoring 4 10000 2006-09-19 14:49:21.579 !MESSAGE Could not find the original of the copied text edit {ReplaceEdit} [16713,4] << !ENTRY org.eclipse.jface 4 2 2006-09-19 14:49:21.579 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 org.eclipse.core.runtime.AssertionFailedException: null argument: at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:84) at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:72) at org.eclipse.ltk.core.refactoring.MultiStateTextFileChange$ComposableUndoEdit.setGroup(MultiStateTextFileChange.java:189) at org.eclipse.ltk.core.refactoring.MultiStateTextFileChange$ComposableUndoEdit.access$1(MultiStateTextFileChange.java:188) at org.eclipse.ltk.core.refactoring.MultiStateTextFileChange$2.documentAboutToBeChanged(MultiStateTextFileChange.java:525) at org.eclipse.jface.text.AbstractDocument.fireDocumentAboutToBeChanged(AbstractDocument.java:606) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1072) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1091) at org.eclipse.text.edits.ReplaceEdit.performDocumentUpdating(ReplaceEdit.java:82) at org.eclipse.text.edits.TextEdit.traverseDocumentUpdating(TextEdit.java:896) at org.eclipse.text.edits.TextEdit.traverseDocumentUpdating(TextEdit.java:889) at org.eclipse.text.edits.TextEditProcessor.executeDo(TextEditProcessor.java:186) at org.eclipse.text.edits.TextEdit.dispatchPerformEdits(TextEdit.java:736) at org.eclipse.text.edits.TextEditProcessor.performEdits(TextEditProcessor.java:154) at org.eclipse.ltk.core.refactoring.MultiStateTextFileChange.getPreviewContent(MultiStateTextFileChange.java:540) at org.eclipse.ltk.internal.ui.refactoring.TextEditChangePreviewViewer.setInput(TextEditChangePreviewViewer.java:202) at org.eclipse.ltk.internal.ui.refactoring.InternalLanguageElementNode.feedInput(InternalLanguageElementNode.java:53) at org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage.showPreview(PreviewWizardPage.java:553) at org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage.access$3(PreviewWizardPage.java:532) at org.eclipse.ltk.internal.ui.refactoring.PreviewWizardPage$5.selectionChanged(PreviewWizardPage.java:523) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1998) at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1131) at org.eclipse.jface.viewers.CheckboxTreeViewer.handleSelect(CheckboxTreeViewer.java:271) at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1157) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:213) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:207) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:374) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3390) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3009) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:132) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:145) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:40) at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startCleanupRefactoring(RefactoringExecutionStarter.java:266) at org.eclipse.jdt.internal.ui.actions.CleanUpAction.runOnMultiple(CleanUpAction.java:188) at org.eclipse.jdt.internal.ui.actions.CleanUpAction.run(CleanUpAction.java:94) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:268) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:244) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3390) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3009) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165) 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:341) at org.eclipse.core.launcher.Main.basicRun(Main.java:285) at org.eclipse.core.launcher.Main.run(Main.java:987) at org.eclipse.core.launcher.Main.main(Main.java:962)

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java