Community
Participate
Working Groups
Build Identifier: 20110301-1815 I just saw this function and wanted to start using it in some of my refactoring, but when I attempt to use the Change Function Signature function, it is never possible to click on Ok nor Preview. I've changed the name of the function and variables with no change. I've also attempted to give input parameters "types" and that dialog doesn't register anything as valid (I tested int & Function). Here is the version & build id for the JSDT I'm using: Version: 1.2.3.v201102160540-7C78FGUF9JgLWNO2UCNqfa Build id: 20110217010641 Reproducible: Always Steps to Reproduce: 1. In a .js file, right click on a function and select Refactor --> Change Funciton signature 2. Make some changes 3. Note that OK and Preview cannot be selected.
Kindly provide us with a sample code to reproduce the bug.
I'm using a simple stub of a function: function test(one, two, thre) { return one + two + three; } I try to change the name of the function to myTestFunction within the Change Function Signature dialog, and the Preview and Ok buttons become disabled. Also, if you attempt to use the Edit dialog for the parameters, you cannot change the type. I've also upgraded to the following: Version: Indigo Release Build id: 20110615-0604
I see the following NPE while trying to use Refactoring->Change Function Signature dialog: !ENTRY org.eclipse.ui 4 0 2013-10-21 17:15:25.678 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.NullPointerException at org.eclipse.wst.jsdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring.checkMethodName(ChangeSignatureRefactoring.java:488) at org.eclipse.wst.jsdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring.checkSignature(ChangeSignatureRefactoring.java:348) at org.eclipse.wst.jsdt.internal.corext.refactoring.structure.ChangeSignatureRefactoring.checkSignature(ChangeSignatureRefactoring.java:343) at org.eclipse.wst.jsdt.internal.ui.refactoring.ChangeSignatureWizard$ChangeSignatureInputPage.updateStatus(ChangeSignatureWizard.java:372) at org.eclipse.wst.jsdt.internal.ui.refactoring.ChangeSignatureWizard$ChangeSignatureInputPage.update(ChangeSignatureWizard.java:358) at org.eclipse.wst.jsdt.internal.ui.refactoring.ChangeSignatureWizard$ChangeSignatureInputPage.access$3(ChangeSignatureWizard.java:357) at org.eclipse.wst.jsdt.internal.ui.refactoring.ChangeSignatureWizard$5.modifyText(ChangeSignatureWizard.java:252) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363) at org.eclipse.jface.window.Window.runEventLoop(Window.java:826) at org.eclipse.jface.window.Window.open(Window.java:802) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:187) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:202) at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:122) at org.eclipse.wst.jsdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:45) at org.eclipse.wst.jsdt.internal.ui.refactoring.UserInterfaceStarter.activate(UserInterfaceStarter.java:57) at org.eclipse.wst.jsdt.internal.corext.refactoring.RefactoringExecutionStarter$1.activate(RefactoringExecutionStarter.java:197) at org.eclipse.wst.jsdt.internal.corext.refactoring.RefactoringExecutionStarter.startChangeSignatureRefactoring(RefactoringExecutionStarter.java:202) at org.eclipse.wst.jsdt.ui.actions.ModifyParametersAction.run(ModifyParametersAction.java:135) at org.eclipse.wst.jsdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:249) at org.eclipse.wst.jsdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:221) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
Created attachment 236706 [details] Patch that fixes the NPE in Change Function Signature dialog
Tha patch fixes the NPE, but I found another issue with refactoring here: Bug #419970 - the refactoring works correctly only when all the files are saved.
Pushed to 3.5.2: http://git.eclipse.org/c/jsdt/webtools.jsdt.core.git/commit/?h=R3_5_maintenance&id=9f0cf4a3bf11c3e3304cb11b0dc069bcb202d0d7 Pushed to 3.6: http://git.eclipse.org/c/jsdt/webtools.jsdt.core.git/commit/?id=d35ac64da4550ccb87943f318bebdf5f9f7ac3ee