Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 136162 - Rename variable broken inside 'if' conditional
Rename variable broken inside 'if' conditional
Status: VERIFIED FIXED
Product: javascript
Classification: Unclassified
Component: Editor
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Torbjorn Norbye
issues@javascript
61fixes2-fixed
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-30 13:24 UTC by zdro
Modified: 2009-02-27 14:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
simple code showing wrong selection in 'if' during 'rename' (21.62 KB, image/jpeg)
2008-05-30 13:26 UTC, zdro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zdro 2008-05-30 13:24:50 UTC
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.
Comment 1 zdro 2008-05-30 13:26:00 UTC
Created attachment 62166 [details]
simple code showing wrong selection in 'if' during 'rename'
Comment 2 Torbjorn Norbye 2008-05-30 17:12:13 UTC
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.

Changeset: a7a08e5b21b8

The fix will appear in build #2104 or later from http://deadlock.netbeans.org/hudson/job/trunk/
Comment 3 Martin Schovanek 2008-06-03 13:03:03 UTC
v.
Comment 4 pgebauer 2008-06-03 22:54:25 UTC
The fix has been ported into the release61_fixes branch:

http://hg.netbeans.org/release61_fixes/a579e6e30351


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo