intellibot icon indicating copy to clipboard operation
intellibot copied to clipboard

IntelliBot: A bug with renaming(Robot Framework, IntelliJ)

Open mgrunko opened this issue 8 years ago • 2 comments

If I rename a variable with "Refactor - Rename", the variable will not be renamed and I get an error message.

=== Steps to reproduce: ===

  1. Right click on a variable
  2. Refactor - Rename
  3. Type in a new name
  4. Press OK

→ Not successfully (also the variable was not renamed) → Error message: com.millennialmedia.intellibot.psi.element.VariableImpl cannot be cast to com.millennialmedia.intellibot.psi.element.Argument → Full text: com.millennialmedia.intellibot.psi.element.VariableImpl cannot be cast to com.millennialmedia.intellibot.psi.element.Argument java.lang.ClassCastException: com.millennialmedia.intellibot.psi.element.VariableImpl cannot be cast to com.millennialmedia.intellibot.psi.element.Argument at com.millennialmedia.intellibot.psi.manip.VariableManipulator.handleContentChange(VariableManipulator.java:16) at com.intellij.psi.PsiReferenceBase.handleElementRename(PsiReferenceBase.java:118) at com.intellij.refactoring.rename.RenameUtil.rename(RenameUtil.java:269) at com.intellij.refactoring.rename.RenameUtil.doRenameGenericNamedElement(RenameUtil.java:226) at com.intellij.refactoring.rename.RenamePsiElementProcessor.renameElement(RenamePsiElementProcessor.java:60) at com.intellij.refactoring.rename.RenameUtil.doRename(RenameUtil.java:187) at com.intellij.refactoring.rename.RenameProcessor.performRefactoring(RenameProcessor.java:413) at com.intellij.refactoring.BaseRefactoringProcessor$7.run(BaseRefactoringProcessor.java:470) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1009) at com.intellij.refactoring.BaseRefactoringProcessor.doRefactoring(BaseRefactoringProcessor.java:452) at com.intellij.refactoring.BaseRefactoringProcessor.access$100(BaseRefactoringProcessor.java:75) at com.intellij.refactoring.BaseRefactoringProcessor$3.run(BaseRefactoringProcessor.java:292) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99) at com.intellij.refactoring.BaseRefactoringProcessor.execute(BaseRefactoringProcessor.java:288) at com.intellij.refactoring.BaseRefactoringProcessor.doRun(BaseRefactoringProcessor.java:225) at com.intellij.refactoring.rename.RenameProcessor.doRun(RenameProcessor.java:128) at com.intellij.refactoring.BaseRefactoringProcessor.run(BaseRefactoringProcessor.java:555) at com.intellij.refactoring.ui.RefactoringDialog.invokeRefactoring(RefactoringDialog.java:189) at com.intellij.refactoring.rename.RenameDialog.performRename(RenameDialog.java:326) at com.intellij.refactoring.rename.RenameDialog.doAction(RenameDialog.java:304) at com.intellij.refactoring.ui.RefactoringDialog.doRefactorAction(RefactoringDialog.java:89) at com.intellij.refactoring.ui.RefactoringDialog$RefactorAction.actionPerformed(RefactoringDialog.java:161) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6535) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6300) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4891) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2750) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:857) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109) at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184) at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229) at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227) at java.security.AccessController.doPrivileged(Native Method) at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227) at java.awt.Dialog.show(Dialog.java:1084) at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:792) at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:465) at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1661) at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1610) at com.intellij.refactoring.ui.RefactoringDialog.access$101(RefactoringDialog.java:38) at com.intellij.refactoring.ui.RefactoringDialog$2.run(RefactoringDialog.java:197) at com.intellij.openapi.project.DumbPermissionServiceImpl.allowStartingDumbModeInside(DumbPermissionServiceImpl.java:37) at com.intellij.openapi.project.DumbService.allowStartingDumbModeInside(DumbService.java:283) at com.intellij.refactoring.ui.RefactoringDialog.show(RefactoringDialog.java:194) at com.intellij.refactoring.rename.PsiElementRenameHandler.rename(PsiElementRenameHandler.java:198) at com.intellij.refactoring.rename.PsiElementRenameHandler.rename(PsiElementRenameHandler.java:169) at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:119) at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:79) at com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:134) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:191) at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:311) at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:958) at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124) at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:281) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:109) at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:513) at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:45) at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:533) at java.awt.Component.processMouseEvent(Component.java:6535) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6300) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4891) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2750) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:857) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

mgrunko avatar May 11 '16 07:05 mgrunko

I do not know if rename is given for free with find usages. There is apparently a couple of kinks with the way i find things. Does you know if the same applies for keywords (easy enough for me to test anyways).

mtrubs avatar May 11 '16 18:05 mtrubs

If I try to rename a keyword, it does not happen anything :)

  1. Right click on a keyword
  2. Refactor - Rename
  3. Type in a new name
  4. Press OK

→ No error messages and the keyword was not renamed.

mgrunko avatar May 18 '16 07:05 mgrunko