This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 176901 - Rename refactoring doesn't handle renaming local variables correctly
Summary: Rename refactoring doesn't handle renaming local variables correctly
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: J Bachorik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-16 06:54 UTC by Alexandr Scherbatiy
Modified: 2010-01-25 05:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2009-11-16 06:54:32 UTC
Steps to reproduce:

- Copy the code to the editor:
-----------------------------------------------------------
function f() {

    var seq = [1, 2, 3];

    for (n in seq) {
        println(n);
    }

    for (m in seq) {
        var n = m * m;
        println(n);
    }

}
-----------------------------------------------------------

- Refactor-> Rename the 'n' to 'n2' variable in 'for (n in seq) {' loop
  The 'n' variable is renamed in the second loop instead of the first

- Build the code

JavaFXApplication13\src\javafxapplication13\Main.fx:18: cannot find symbol
symbol  : variable n2
location: class javafxapplication13.Main
        println(n2);
1 error
Comment 1 J Bachorik 2009-11-17 07:28:52 UTC
Actually, this issue will be observable when renaming any local variable with the same named non-local variable.
I have fix ready but it will probably not get to 6.8.
Comment 2 J Bachorik 2009-12-01 03:33:37 UTC
fixed in http://hg.netbeans.org/javafx/rev/149afda001e7
Comment 3 Alexandr Scherbatiy 2009-12-09 07:07:41 UTC
verified in NetBeans-JavaFX-Soma  #60
Comment 4 rbalada 2010-01-21 02:36:34 UTC
The fix has been ported to release68_fixes branch
http://hg.netbeans.org/javafx/rev/67fcd4101012
Comment 5 Alexandr Scherbatiy 2010-01-25 05:08:24 UTC
Verified in netbeans-6.8-201001241915-javafx-full.zip patch1 from
/builds/netbeans/6.8/fixes