Type annotations on static member access.

2 views
Skip to first unread message

Srikanth

unread,
Dec 1, 2009, 12:16:59 AM12/1/09
to Type annotations (JSR 308) discussions
Hello,

Section "B.1 Examples of annotation syntax" of the Type
annotations specification indicates
that type annotations could be applied to static member access as in

@NonNull Type.field

Such a construct though is rejected by javac (7b75).

Also, as far as I can tell, the "detailed grammar changes"
provided in the document cannot
be used to derive such a construct.

So is this a problem with the specification or is it that the
implementation is broken ?

Thanks in advance for any clarifications.
Srikanth

Mahmood Ali

unread,
Dec 1, 2009, 7:06:01 AM12/1/09
to jsr308-discuss
Greetings Srikanth,

Thanks for the catch.  This is a specification bug.  The example should have been for static class member access in a declaration:

    @NonNull Map.Entry mapEntry;

The compiler is correct in this case.

Thanks for noticing it, and please report any further errors you may find.

Regards,
Mahmood
Reply all
Reply to author
Forward
0 new messages