Project: JDT
Bug 66250 RC1- NPE renaming a class with compilation errors [refactoring]
Reported: 2004-06-09 03:03:47 | Status: verified fixed

1- Refactor rename of class with compilation errors from Package explorer context menu 2- in the "Rename compilation unit" popup type new name, unselect "update references", select "Update textual matches...", leave unselected "Update fully qualified...", press "Preview" button 3- get the following error: eclipse.buildId=I200405290105 java.version=1.4.2_04 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Error Jun 09, 2004 09:00:24.522 Internal Error java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:283) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:282) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:559) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:405) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.computeSuccessorPage(UserInputWizardPage.java:74) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.getNextPage(UserInputWizardPage.java:114) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.previewPressed(RefactoringWizardDialog2.java:429) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.access$3(RefactoringWizardDialog2.java:427) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2$1.widgetSelected(RefactoringWizardDialog2.java:562) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2716) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2382) at org.eclipse.jface.window.Window.runEventLoop(Window.java:668) at org.eclipse.jface.window.Window.open(Window.java:648) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:121) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:40) at org.eclipse.jdt.internal.ui.refactoring.UserInterfaceStarter.activate(UserInterfaceStarter.java:54) at org.eclipse.jdt.internal.ui.refactoring.reorg.RenameUserInterfaceStarter.activate(RenameUserInterfaceStarter.java:113) at org.eclipse.jdt.ui.refactoring.RenameSupport.openDialog(RenameSupport.java:108) at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:175) at org.eclipse.jdt.internal.ui.refactoring.actions.RenameJavaElementAction.run(RenameJavaElementAction.java:96) at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:116) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:212) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:188) at org.eclipse.jface.action.Action.runWithEvent(Action.java:881) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:915) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:866) at org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:785) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2716) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2382) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1363) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1334) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:253) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:334) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:128) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:185) at org.eclipse.core.launcher.Main.run(Main.java:638) at org.eclipse.core.launcher.Main.main(Main.java:622) Caused by: java.lang.NullPointerException at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.removeReferences(TextMatchUpdater.java:150) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.addCuTextMatches(TextMatchUpdater.java:144) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.addTextMatches(TextMatchUpdater.java:116) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.addTextMatches(TextMatchUpdater.java:126) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.addTextMatches(TextMatchUpdater.java:126) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.addTextMatches(TextMatchUpdater.java:126) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.addTextMatches(TextMatchUpdater.java:126) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.addTextMatches(TextMatchUpdater.java:126) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.addTextMatches(TextMatchUpdater.java:126) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.addTextMatches(TextMatchUpdater.java:126) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.updateTextMatches(TextMatchUpdater.java:82) at org.eclipse.jdt.internal.corext.refactoring.rename.TextMatchUpdater.perform(TextMatchUpdater.java:70) at org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor.addTextMatches(RenameTypeProcessor.java:709) at org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor.createChangeManager(RenameTypeProcessor.java:737) at org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor.checkFinalConditions(RenameTypeProcessor.java:338) at org.eclipse.jdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor.checkFinalConditions(RenameCompilationUnitProcessor.java:259) at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:134) at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:84) at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:114) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1673) at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:58) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/RenameNonPrivateField/test17/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenameNonPrivateField/test17/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/test6/in/r/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenamePackage/test6/out/p1/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenameType/test62/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/RenameType/test62/out/B.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenameNonPrivateFieldTests.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenamePackageTests.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RenameTypeTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameFieldProcessor.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/TextMatchUpdater.java