There are two styles of 'rename' functionality, one that uses a refactor popup and another that simply highlights the
text/variable being renamed and all instances are changed as you type. This defect is for the latter.
When an instance of the variable I'm renaming is in an 'if' conditional, and a space precedes it, the selection of that
instance is off by a character. The space before the word is included in the selection being changed, while the last
character of the name is not.
This is a big problem because this then causes the variable to not be renamed properly (the last character is
duplicated), which can then lead to subtle problems with the code and hours of wasted time debugging.
Attachment to follow.
Created attachment 62166 [details]
simple code showing wrong selection in 'if' during 'rename'
Thank you! The problem had to do with spaces inside the left parenthesis of an if conditional expression. I've fixed the
problem and have added unit tests for this scenario.
The fix will appear in build #2104 or later from http://deadlock.netbeans.org/hudson/job/trunk/
The fix has been ported into the release61_fixes branch: