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 19906 - "constant expression required" when compiling source attached
Summary: "constant expression required" when compiling source attached
Status: CLOSED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@platform
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-29 15:23 UTC by peterp
Modified: 2008-12-23 11:49 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 peterp 2002-01-29 15:23:09 UTC
Compiling this source code within FFJ gives "constant expression required". It 
compiles fine from commandline.


/*
 * Class.java
 *
 * Created on 29 January 2002, 16:13
 *
 * @author  pp124457
 * @version 
**/
 public class Test {
    
    public static final int A = 1;
    public static final int B = 2;
    

    /** Creates new Test */
    public Test() { }
        public static void main(String[] args) {
        Test t = new Test();
        int param = 1;
        switch (param) {
        case t.A:
        System.out.println("It is : " + param);
        break;
        case t.B:
        System.out.println("It is: " + param);
        break;
        }      }
}


[FFJ CUSTBUG] *** bug reported by FFJ customer ***
Comment 1 Jan Zajicek 2002-01-31 15:30:20 UTC
Tested on jdk1.4.0-b92 (fcs) and jsk1.3.1_02 - javac, fastjavac - from
ide and from commandline. Code wasn't compiled in any case. So closing
 this as invalid - error isn't in NB. t.A is constant but none from
tested compilers handle it so, whereas Test.A is ok.

Comment 2 Quality Engineering 2003-07-01 15:54:04 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified.

Comment 3 Quality Engineering 2003-07-01 16:21:17 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.