Bug 102265

Summary: Error from javac not reported by JDT compiler
Product: [Eclipse Project] JDT Reporter: Nick Lerissa <nick_lerissa>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Nick Lerissa CLA 2005-06-30 01:02:29 EDT
When I compile TestEnum.java with javac I get the following
error that I don't get from within Eclipse:
 
% javac TestEnum.java
TestEnum.java:10: illegal reference to static field from initializer
                if (someList == null) {
                    ^
TestEnum.java:11: illegal reference to static field from initializer
                        someList = new ArrayList();
                        ^
2 errors

// Following is TestEnum.java
import java.util.ArrayList;

public enum TestEnum {
	one,
	two;
	
	static ArrayList someList;
	
	private TestEnum() {
		if (someList == null) {
			someList = new ArrayList();
		}
	}
}
Comment 1 Philipe Mulet CLA 2005-06-30 03:52:08 EDT
Added EnumTest#test118

*** This bug has been marked as a duplicate of 101713 ***