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 108782

Summary: Order of declaration when introducing filed
Product: java Reporter: Jiri Prox <jiriprox>
Component: HintsAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jiri Prox 2007-07-03 17:33:27 UTC
Product Version: NetBeans IDE Dev (Build 200707012149) Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b04 System:
Linux version 2.6.5-1.358 running on i386; UTF-8; en_US (nb) Userdir: /space/u6

The introduced filed it inserted before other filed declaration, although it can have reference to it. 

Steps to reproduce: 
1) introduce field from "d+x" in following code and select "initialize in field"

public class ClassA {
    
    int d = 3;
    
    int x = 3;
           
    public void neco() {
        System.out.println(d + x);
    }
}


Result (invalid forward reference):
public class ClassA {
    public int name = d + x;
    
    int d = 3;
    
    int x = 3;
           
    public void neco() {
        System.out.println(name);
    }
}
Comment 1 Jan Lahoda 2007-10-18 13:28:21 UTC
We can probably live with this problem.
Comment 2 Jan Lahoda 2008-11-21 10:52:28 UTC
later.
Comment 3 Quality Engineering 2009-11-02 11:01:35 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX