Project: JDT
Bug 188087 [introduce parameter object] NPE when introducing to overriden method if method from binary
Reported: 2007-05-21 09:04:58 | Status: verified fixed

I20070517-1700 Given: package test; import java.util.AbstractList; public class MyList extends AbstractList { public Object get(int index) { return null; } public int size() { return 0; } } 1. Select 'get' 2. Refactor>Introduce Parameter Object... 3. Say 'Yes' on the warning dialog Is: java.lang.NullPointerException at org.eclipse.jdt.internal.corext.refactoring.structure.ParameterObjectFactory.<init>(ParameterObjectFactory.java:69) at org.eclipse.jdt.internal.corext.refactoring.structure.IntroduceParameterObjectRefactoring.initializeFields(IntroduceParameterObjectRefactoring.java:320) at org.eclipse.jdt.internal.corext.refactoring.structure.IntroduceParameterObjectRefactoring.<init>(IntroduceParameterObjectRefactoring.java:297) at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startIntroduceParameterObject(RefactoringExecutionStarter.java:484) at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startIntroduceParameterObject(RefactoringExecutionStarter.java:469) at org.eclipse.jdt.internal.ui.actions.IntroduceParameterObjectAction.run(IntroduceParameterObjectAction.java:129) at org.eclipse.jdt.internal.ui.actions.IntroduceParameterObjectAction.run(IntroduceParameterObjectAction.java:120) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:272) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:244) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) 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.equinox.launcher.Main.invokeFramework(Main.java:497) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436) at org.eclipse.equinox.launcher.Main.run(Main.java:1162) at org.eclipse.equinox.launcher.Main.main(Main.java:1137)

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringExecutionStarter.java org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/RefactoringMessages.java