Bug 273990 - [compiler] FUP of 269388: Eclipse accepts code rejected by javac
Summary: [compiler] FUP of 269388: Eclipse accepts code rejected by javac
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-28 04:56 EDT by Srikanth Sankaran CLA
Modified: 2009-08-04 01:28 EDT (History)
0 users

See Also:


Attachments
Possible fix (1.34 KB, patch)
2009-04-28 15:39 EDT, Kent Johnson CLA
no flags Details | Diff
Proposed patch and testcase (2.83 KB, patch)
2009-06-19 12:25 EDT, Kent Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2009-04-28 04:56:49 EDT
I20090426-2000

While verifying the fix for bug# 269388, I noticed
that javac 1.6 rejects the following with an "illegal
forward reference" error while we gladly accept it.

public enum Enun {
        A(Enun.STATIK);
        private static int STATIK = 1;

        private Enun(final int i) {
        }
}

javac needs STATIK to be declared as final before it would
accept it.
Comment 1 Kent Johnson CLA 2009-04-28 15:39:34 EDT
Created attachment 133621 [details]
Possible fix
Comment 2 Kent Johnson CLA 2009-06-19 12:25:21 EDT
Created attachment 139653 [details]
Proposed patch and testcase
Comment 3 Kent Johnson CLA 2009-06-19 12:27:20 EDT
Released for 3.6M1 in HEAD
Comment 4 Srikanth Sankaran CLA 2009-08-04 01:28:05 EDT
Verified for 3.6M1 using build I20090803-1300