Bug 176901

Summary: Rename refactoring doesn't handle renaming local variables correctly
Product: javafx Reporter: Alexandr Scherbatiy <sunflower>
Component: UnsupportedAssignee: J Bachorik <yardus>
Status: VERIFIED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P3 CC: sustaining
Version: 6.x   
Target Milestone: 6.x   
Hardware: PC   
OS: Windows XP   
Whiteboard: 68patch1-verified
Issue Type: DEFECT Exception Report:

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
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo