Community
Participate
Working Groups
For the following code public abstract class BooleanValueNode { public final static BooleanValueNode FALSE_NODE = new BooleanValueNode() { public BooleanValueNode not() { return TRUE_NODE; } // line 17 in original code public Node and( Node n ) { return FALSE_NODE; } public Node or( Node n ) { return n; } }; public final static BooleanValueNode TRUE_NODE = new BooleanValueNode() { public BooleanValueNode not() {return FALSE_NODE;} public Node and( Node n ) {return n;} public Node or( Node n ) {return TRUE_NODE;} }; private BooleanValueNode() { } public abstract BooleanValueNode not(); public abstract Node and( Node n ); public abstract Node or( Node n ); } I get the following compile time error: Report for 1 markers: Marker 1: Resource: [...]/BooleanValueNode.java, Line: 17 Message: Cannot reference a field before it is defined Marker type: org.eclipse.jdt.core.problem Priority: Normal I think this is not conforming to the JLS: http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#1898 8 Jikes compiles the class without problems. I didn't find a bug report on the eclipse website. Should I post one? Regards, Ilja
Reproduced on build 20020226. Indeed this is a bug, we should not complain when the forward reference is nested inside an innerclass.
The check for not complaining inside innerclasses did only work for instance fields. Fixed