Introduce Parameter refactoring broken in 10.5 EAP (106.330)
It looks like only half of the refactoring step is done (i.e. parameter is added to method signature) but the actual expression/value doesn't get pulled up to the place where the method is call.
The error status shows this:
Error during dispatching of java.awt.event.KeyEvent[KEY_PRESSED,keyCode=80,keyText=P,keyChar=Undefined keyChar,modifiers=Ctrl+Alt,extModifiers=Ctrl+Alt,keyLocation=KEY_LOCATION_STANDARD,rawCode=80,primaryLevelUnicode=112,scancode=25] on frame0: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at com.intellij.psi.impl.source.PsiParameterImpl.getDeclarationScope(PsiParameterImpl.java:196)
at com.intellij.psi.impl.source.PsiParameterImpl.getUseScope(PsiParameterImpl.java:234)
at com.intellij.psi.impl.search.PsiSearchHelperImpl.getUseScope(PsiSearchHelperImpl.java:71)
at com.intellij.refactoring.rename.inplace.VariableInplaceRenamer.checkLocalScope(VariableInplaceRenamer.java:173)
at com.intellij.refactoring.rename.inplace.VariableInplaceRenamer.performInplaceRename(VariableInplaceRenamer.java:147)
at com.intellij.refactoring.introduceVariable.VariableInplaceIntroducer.performInplaceRename(VariableInplaceIntroducer.java:163)
at com.intellij.refactoring.introduceParameter.InplaceIntroduceParameterPopup$1.run(InplaceIntroduceParameterPopup.java:144)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:115)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:91)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:79)
at com.intellij.refactoring.introduceParameter.InplaceIntroduceParameterPopup.a(InplaceIntroduceParameterPopup.java:127)
at com.intellij.refactoring.introduceParameter.InplaceIntroduceParameterPopup.inplaceIntroduceParameter(InplaceIntroduceParameterPopup.java:123)
at com.intellij.refactoring.introduceParameter.IntroduceParameterHandler$Introducer.introduceParameter(IntroduceParameterHandler.java:433)
at com.intellij.refactoring.introduceParameter.IntroduceParameterHandler.a(IntroduceParameterHandler.java:169)
at com.intellij.refactoring.introduceParameter.IntroduceParameterHandler.access$000(IntroduceParameterHandler.java:76)
at com.intellij.refactoring.introduceParameter.IntroduceParameterHandler$1.pass(IntroduceParameterHandler.java:94)
at com.intellij.refactoring.introduceParameter.IntroduceParameterHandler$1.pass(IntroduceParameterHandler.java:85)
at com.intellij.refactoring.introduceField.ElementToWorkOn.processElementToWorkOn(ElementToWorkOn.java:120)
at com.intellij.refactoring.introduceParameter.IntroduceParameterHandler.invoke(IntroduceParameterHandler.java:85)
at com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:85)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$3.performAction(IdeKeyEventDispatcher.java:524)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:564)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.d(IdeKeyEventDispatcher.java:444)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:197)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:497)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:410)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
请先登录再写评论。
Sorry for the inconvenience. The issue is already fixed, fix would be available in next EAP.
Thank you
Are you sure this is fixed. It seems still broken for me in 106.447.
There was another exception, but now it is fixed also. Sorry for the inconvenience
I'd love to get a new EAP build with this fix. It's amazing how much I depend on this refactoring. :(
The new EAP is just released.
Unfortunately not all my fixes were included. But for the most cases it should work now. Sorry for the inconvenience.
Build 107.105
Hi, I am still seeing problems with introduce parameter refactoring - it just doesn't work - I get the new param added to the method signature but no substitution frmo where I introduced and also no refactoring of calling methods with the new param value.
Is this a known problem and going to be fixed or is it user error on my part ?
Thanks,
Roddy
Hopefully it was fixed. Please see IDEA-67927
Thank you