[JSR308] annotations on types of the local variables

David Wagner daw at cs.berkeley.edu
Fri May 18 20:22:51 EDT 2007

Eugene writes:
>  Several members of the Java compiler team suggested that it is a bad 
>idea to use @Target meta-annotation to guard against ambiguity of those 
>annotations. I guess the primary concern is that grammar scanner can't 
>tell what type of annotation it is and it will also require an extra 
>steps in the AST processor. So, we should at least include this into the 
>list of unresolved issues.

I would like to argue that this objection should be given a very low
priority.  Syntax should be designed to make it easy for programmers to
understand and use, and a minor impact on compiler writers seems like
it should be distinctly secondary.

If the JSR's syntax is considered the best for programmers, and if that
means that an extra step in the AST processor is required, so be it.
I'd much rather see the compiler writer have to do a little extra work
than force programmers to use an inferior syntax.

More information about the JSR308 mailing list