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 237127 - [Introduce parameter] Introduce parameter may generate in-compilable code
Summary: [Introduce parameter] Introduce parameter may generate in-compilable code
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-15 09:59 UTC by Jiri Prox
Modified: 2016-07-07 07:17 UTC (History)
0 users

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 Jiri Prox 2013-10-15 09:59:12 UTC
Introduce parameter may generate in-compilable code

Steps to reproduce:
1) have a code:

public class Test {

    int field = 3;
    public Test() {
        int x = field;
    }

    
}

2) introduce parameter on the line int x= field;
3) select 'Create new method and Delegate from existing'

-> 

public class Test {

    int field = 3;
    public Test() {
        this(field);  // <-- error: cannot reference field ....
    }

    public Test(int field1) {
        int x = field1;
    }

    
}


Product Version: NetBeans IDE Dev (Build 20131014-f962ff2a7ce7)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b49
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b107
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:17:33 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