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 242436

Summary: [introduce method] Renamed local variable
Product: java Reporter: Jiri Prox <jiriprox>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description Jiri Prox 2014-02-27 23:32:43 UTC
Introduce method renames local variable, which makes the code uncompilable 

Steps to reproduce:
1) have a method:
public void setValue(String path, boolean value) {
        JTreeOperator jto = getTreeOperator();
        String[] pathElements = path.split("\\|");
        TreePath tp = new TreePath(pathElements);
 //start
        Object root = jto.getRoot();
        Object[] children = jto.getChildren(root);
        for (Object object : children) {
            System.out.println(object.getClass().getName());
            
        }        
//end
        jto.selectPath(tp);        
        jto.clickOnPath(tp);        
    }

2) select the code between start and end comment
3) introduce method

->

    public void setValue(String path, boolean value) {
        JTreeOperator jto = getTreeOperator();
        String[] pathElements = path.split("\\|");
        TreePath tp = new TreePath(pathElements);
        ddd(jto);
        jto1.selectPath(tp); //<-jto1 not defined
        jto1.clickOnPath(tp);        
    }

    private void ddd(JTreeOperator jto1) {
        Object root = jto1.getRoot();
        Object[] children = jto1.getChildren(root);
        for (Object object : children) {
            System.out.println(object.getClass().getName());
            
        }        
    }



Product Version: NetBeans IDE Dev (Build 20140227-fe642968b606)
Updates: Updates available
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b65
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b123
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
Comment 1 Martin Balin 2016-07-07 07:16:43 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss