Bug 102265 - Error from javac not reported by JDT compiler
Summary: Error from javac not reported by JDT compiler
Status: RESOLVED DUPLICATE of bug 101713
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-30 01:02 EDT by Nick Lerissa CLA
Modified: 2005-06-30 03:52 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***