Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356444 - [refactoring] RenameLinkedMode fails with qualified names
Summary: [refactoring] RenameLinkedMode fails with qualified names
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 354731 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-01 05:16 EDT by Jan Koehnlein CLA
Modified: 2017-09-19 17:32 EDT (History)
3 users (show)

See Also:
jan: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Koehnlein CLA 2011-09-01 05:16:02 EDT
When refactoring is triggered on a parent segement of a qualified name, the rename linked mode throws an IllegalStateException.

Reproducible in Xtend, dmodel etc., e.g.

  class X extends javaPackage.JavaClass {}

where JavaClass is an existing Java class. 
Trigger refactoring on "javaPackage" -> Exception:

Caused by: java.lang.IllegalStateException: Current selection is not within any
linked editing position
    at
org.eclipse.xtext.ui.refactoring.ui.RenameLinkedMode.start(RenameLinkedMode.java:82)
    at
org.eclipse.xtext.ui.refactoring.ui.RenameRefactoringController$1.run(RenameRefactoringController.java:105)
    at
org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    ... 51 more

The cursor was inside 'example'. After that failure, other attempts give me

java.lang.NullPointerException
    at
org.eclipse.xtext.ui.refactoring.ui.RenameRefactoringController.startRefactoring(RenameRefactoringController.java:66)
    at
org.eclipse.xtext.ui.refactoring.ui.RenameRefactoringController.startLinkedEditing(RenameRefactoringController.java:94)
    at
org.eclipse.xtext.ui.refactoring.ui.RenameRefactoringController.startRefactoring(RenameRefactoringController.java:57)
    at
org.eclipse.xtext.ui.refactoring.ui.DefaultRenameElementHandler.startRenameElement(DefaultRenameElementHandler.java:80)
    at
org.eclipse.xtext.ui.refactoring.ui.DefaultRenameElementHandler.execute(DefaultRenameElementHandler.java:59)
Comment 1 Jan Koehnlein CLA 2011-09-01 05:20:24 EDT
*** Bug 354731 has been marked as a duplicate of this bug. ***
Comment 2 Jan Koehnlein CLA 2011-09-01 05:21:13 EDT
Continued from bug 354731
Comment 3 Holger Schill CLA 2011-09-12 08:32:14 EDT
How should the implementation behave in this case. I think it is unpossible to find out what element leaded to a special part of a qualified name. Should the refactoring just jump to the offset of the last segment of a qualified name? Or should the refactoring open a dialog to point out that a refactoring is not possible. Or should the refactoring just not respond?
Comment 4 Jan Koehnlein CLA 2011-09-12 08:37:47 EDT
This should already be fixed on HEAD. The last segment is selected in this case. Please reopen if the problem persists.
Comment 5 Karsten Thoms CLA 2017-09-19 17:21:23 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 6 Karsten Thoms CLA 2017-09-19 17:32:46 EDT
Closing all bugs that were set to RESOLVED before Neon.0