Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1.2RC1
-
Fix Version/s: 2.5.0Release
-
Component/s: Refactoring
-
Labels:None
-
Number of attachments :
Description
Given this code:
class Result {
def getVal2() {
}
}
def res = new Result()
res.val2
Invoke rename on either the getVal2 declaration or the val2 reference this exception comes out:
org.eclipse.jface.text.BadLocationException: First position: 'getVal2' at 72, this position: 'val2' at 179
at org.eclipse.jface.text.link.LinkedPositionGroup.enforceEqualContent(LinkedPositionGroup.java:132)
at org.eclipse.jface.text.link.LinkedPositionGroup.addPosition(LinkedPositionGroup.java:113)
at org.codehaus.groovy.eclipse.refactoring.actions.GroovyRenameLinkedMode.start(GroovyRenameLinkedMode.java:172)
at org.codehaus.groovy.eclipse.refactoring.actions.RenameDispatcherAction.run(RenameDispatcherAction.java:53)
at org.codehaus.groovy.eclipse.refactoring.actions.GroovyRenameAction.run(GroovyRenameAction.java:44)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:278)
...
I need to filter out all references that are not exactly the same string value as the declaration.
Fixed locally. Just filter out the occurrences that do not have the correct source length.