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 - Order of declaration when introducing filed
Summary: Order of declaration when introducing filed
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-03 17:33 UTC by Jiri Prox
Modified: 2009-11-02 11:01 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 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