Project: JDT
Bug 62666 Exception when renaming a package [refactoring]
Reported: 2004-05-18 11:34:45 | Status: verified fixed

I200405171219 I am renaming a package due to a conflict between a package name and a class name. When the SearchPattern is created in RenamePackageProcessor.getReferencesToTypesInNamesakes(), a null is returned because there are no typesToSearch, ie, IType[0]. java.lang.reflect.InvocationTargetException at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at java.lang.reflect.InvocationTargetException.<init> (InvocationTargetException.java:66) 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.internalPerformFinish (RefactoringWizard.java:533) at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.performFinish (UserInputWizardPage.java:153) at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performFinish (RefactoringWizard.java:599) at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.okPressed (RefactoringWizardDialog2.java:406) at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:365) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:505) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java) at org.eclipse.jface.window.Window.runEventLoop(Window.java) 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.activa te(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.ui.actions.RetargetAction.runWithEvent (RetargetAction.java:212) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:899) at org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java:850) at org.eclipse.jface.action.ActionContributionItem$7.handleEvent (ActionContributionItem.java:769) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java) 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:97) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:299) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:256) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:127) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:59) at java.lang.reflect.Method.invoke(Method.java:390) at org.eclipse.core.launcher.Main.basicRun(Main.java:184) at org.eclipse.core.launcher.Main.run(Main.java:637) at org.eclipse.core.launcher.Main.main(Main.java:621) Caused by: java.lang.NullPointerException at java.lang.Throwable.<init>(Throwable.java) at java.lang.Throwable.<init>(Throwable.java) at java.lang.NullPointerException.<init>(NullPointerException.java:60) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.findIndexMatches (MatchLocator.java:266) at org.eclipse.jdt.internal.core.search.PatternSearchJob.search (PatternSearchJob.java:107) at org.eclipse.jdt.internal.core.search.PatternSearchJob.execute (PatternSearchJob.java:64) at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob (JobManager.java:259) at org.eclipse.jdt.core.search.SearchEngine.findMatches (SearchEngine.java:455) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:756) at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine.internalSea rch(RefactoringSearchEngine.java:119) at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine.search (RefactoringSearchEngine.java:93) at org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor.getRe ferencesToTypesInNamesakes(RenamePackageProcessor.java:350) at org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor.check FinalConditions(RenamePackageProcessor.java:289) at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFi nalConditions(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.ltk.core.refactoring.PerformChangeOperation.run (PerformChangeOperation.java:182) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1674) 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/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java