Community
Participate
Working Groups
BETA_JAVA8: The following program triggers three errors: - Syntax error on token ".", @ expected after this token - Syntax error, insert "SimpleName" to complete ReferenceType - Syntax error, insert "VariableDeclarators" to complete LocalVariableDeclaration // -------------- public class X { public static void main(String[] args) { @Marker X.@Marker Y.foo(); } static class Y { static void foo() { } } } @java.lang.annotation.Target (java.lang.annotation.ElementType.TYPE_USE) @interface Marker { } // ------------------ It would be ideal if we report a clearer message that says "Type annotations are illegal on type names used to access static members". However this is very hard to do in the current design of the scanner & parser. This defect is raised just so this stays on our radar. No plans to fix as of now. It is also not being marked as a blocker for the JSR308 umbrella bug.