Project: JDT
Bug 40885 Extract Method Dialog: NPE from keyhandler in "Parameters" table [refactoring]
Reported: 2003-07-29 06:42:11 | Status: resolved fixed

Build id: 200307230800, plugin-exports from20030729_0833 ### from Smoke Test, Refactoring: - have JUnit 3.8.1 as source project - In file junit.swingui.AboutDialog.java at the end of constructor AboutDialog(JFrame parent) select the following lines: constraintsLogo1.gridx = 2; constraintsLogo1.gridy = 0; constraintsLogo1.gridwidth = 1; constraintsLogo1.gridheight = 1; constraintsLogo1.anchor = GridBagConstraints.CENTER; getContentPane().add(logo, constraintsLogo1); - select Refactor > Extract Method... from the workbench menu ### new: - Click Button "Edit" - Click Button "Cancel" - Press any key (e.g. left arrow) - Result in Error log: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.refactoring.ChangeParametersControl$5.keyReleased(ChangeParametersControl.java:296) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:124) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:872) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:857) at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1675) at org.eclipse.swt.widgets.Control.sendKeyEvent(Control.java:1671) at org.eclipse.swt.widgets.Control.WM_KEYUP(Control.java:3500) at org.eclipse.swt.widgets.Control.windowProc(Control.java:2900) at org.eclipse.swt.widgets.Display.windowProc(Display.java:2713) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1338) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1876) 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:56) at org.eclipse.jdt.ui.actions.ExtractMethodAction.run(ExtractMethodAction.java:70) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:196) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:172) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:187) at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:212) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:542) at org.eclipse.jface.action.ActionContributionItem.access$4(ActionContributionItem.java:496) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:468) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2188) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1878) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1680) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1663) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858) 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)

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