Project: JDT
Bug 37046 Refactor failed to perform a rename action due to NPE
Reported: 2003-04-29 07:33:30 | Status: resolved fixed

Build 20030422 Steps: - get project org.eclipse.jdt.core.tests.model - open file org/eclipse/jdt/core/tests/dom/ASTTest.java - select variable 'ast' declared on line 575 - try to rename it into 'testAST', following internal error occurs: !ENTRY org.eclipse.jdt.ui 4 10001 Apr 29, 2003 13:27:00.625 !MESSAGE Internal Error !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$Compilati onUnitAnnotationModel.endReporting(CompilationUnitDocumentProvider at org.eclipse.jdt.internal.core.WorkingCopy.reportProblemsIfNeeded (WorkingCopy.java:228) at org.eclipse.jdt.internal.core.WorkingCopy.makeConsistent (WorkingCopy.java:411) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation (ReconcileWorkingCopyOperation.java:48) at org.eclipse.jdt.internal.core.JavaModelOperation.execute (JavaModelOperation.java:365) at org.eclipse.jdt.internal.core.JavaModelOperation.run (JavaModelOperation.java:704) at org.eclipse.jdt.internal.core.JavaElement.runOperation (JavaElement.java:540) at org.eclipse.jdt.internal.core.WorkingCopy.reconcile (WorkingCopy.java:504) at org.eclipse.jdt.internal.core.WorkingCopy.reconcile (WorkingCopy.java:495) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.doSaveDoc ument(CompilationUnitDocumentProvider.java:906) at org.eclipse.ui.texteditor.AbstractDocumentProvider.saveDocument (AbstractDocumentProvider.java:459) at org.eclipse.jdt.internal.corext.textmanipulation.TextBufferFactory.save (TextBufferFactory.java:178) at org.eclipse.jdt.internal.corext.textmanipulation.TextBuffer.save (TextBuffer.java:439) at org.eclipse.jdt.internal.corext.refactoring.changes.TextFileChange.perform (TextFileChange.java:211) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation$1.run (PerformChangeOperation.java:173) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation (BatchOperation.java:34) at org.eclipse.jdt.internal.core.JavaModelOperation.execute (JavaModelOperation.java:365) at org.eclipse.jdt.internal.core.JavaModelOperation.run (JavaModelOperation.java:704) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1595) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:2783) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.executeChange (PerformChangeOperation.java:183) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.run (PerformChangeOperation.java:145) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:302) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.run (RefactoringWizardDialog2.java:266) at org.eclipse.jdt.internal.ui.refactoring.PerformRefactoringUtil.performRefactorin g(PerformRefactoringUtil.java:53) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish (RefactoringWizard.java:363) at org.eclipse.jdt.internal.ui.refactoring.UserInputWizardPage.performFinish (UserInputWizardPage.java:119) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish (RefactoringWizard.java:426) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.okPressed (RefactoringWizardDialog2.java:383) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:256) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1933) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1640) at org.eclipse.jface.window.Window.runEventLoop(Window.java:583) at org.eclipse.jface.window.Window.open(Window.java:563) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate (RefactoringStarter.java:70) at org.eclipse.jdt.internal.ui.refactoring.actions.RenameTempAction.run (RenameTempAction.java:86) at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:125) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:193) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:169) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:526) at org.eclipse.jface.action.ActionContributionItem.access$4 (ActionContributionItem.java:480) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent (ActionContributionItem.java:452) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1933) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1640) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583) !ENTRY org.eclipse.jdt.ui 4 10001 Apr 29, 2003 13:27:00.635 !MESSAGE Internal Error !STACK 0 java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:313) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:252) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.run (RefactoringWizardDialog2.java:266) at org.eclipse.jdt.internal.ui.refactoring.PerformRefactoringUtil.performRefactorin g(PerformRefactoringUtil.java:53) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish (RefactoringWizard.java:363) at org.eclipse.jdt.internal.ui.refactoring.UserInputWizardPage.performFinish (UserInputWizardPage.java:119) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish (RefactoringWizard.java:426) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizardDialog2.okPressed (RefactoringWizardDialog2.java:383) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:256) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1933) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1640) at org.eclipse.jface.window.Window.runEventLoop(Window.java:583) at org.eclipse.jface.window.Window.open(Window.java:563) at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate (RefactoringStarter.java:70) at org.eclipse.jdt.internal.ui.refactoring.actions.RenameTempAction.run (RenameTempAction.java:86) at org.eclipse.jdt.ui.actions.RenameAction.run(RenameAction.java:125) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:193) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:169) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:526) at org.eclipse.jface.action.ActionContributionItem.access$4 (ActionContributionItem.java:480) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent (ActionContributionItem.java:452) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1933) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1640) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583) Caused by: java.lang.IllegalArgumentException: at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:56) at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:41) at org.eclipse.core.runtime.Status.setMessage(Status.java:147) at org.eclipse.core.runtime.Status.<init>(Status.java:66) at org.eclipse.jdt.internal.ui.refactoring.changes.ChangeExceptionHandler.handle (ChangeExceptionHandler.java:81) at org.eclipse.jdt.internal.corext.refactoring.base.Change.handleException (Change.java:105) at org.eclipse.jdt.internal.corext.refactoring.changes.TextFileChange.perform (TextFileChange.java:214) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation$1.run (PerformChangeOperation.java:173) at org.eclipse.jdt.internal.core.BatchOperation.executeOperation (BatchOperation.java:34) at org.eclipse.jdt.internal.core.JavaModelOperation.execute (JavaModelOperation.java:365) at org.eclipse.jdt.internal.core.JavaModelOperation.run (JavaModelOperation.java:704) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1595) at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:2783) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.executeChange (PerformChangeOperation.java:183) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.run (PerformChangeOperation.java:145) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:302) ... 40 more

Files changed in fix:
org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/changes/ChangeExceptionHandler.java