Type annotations on static member access.

Visto 2 veces
Saltar al primer mensaje no leído

Srikanth

no leída,
1 dic 2009, 0:16:591/12/09
a 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

no leída,
1 dic 2009, 7:06:011/12/09
a 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
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos