Annotations on extended dimension in method declarations.

Michael Ernst mernst at
Tue Jan 29 21:55:23 PST 2013


Thanks for the clarification; I appreciate it.

I expect that the method syntax was included specifically for consistency
with the variable syntax, and so it seems unclean to me to support type
annotations in one place but not in another that was designed to mimic the
first one.  I hate to provide grist for another Java Puzzlers book.

I don't think this change would make the specification shorter, because we
would have to add a paragraph explaining why we are treating some array
brackets differently than other array brackets.  This will sound like an
ugly wart that clutters the spec and requires an apology, rather than
keeping the language clean.

With regard to the argument from implementation convenience:  The JSR 308
reference implementation uses a single grammar production to parse array
brackets (and the type annotations that precede them) wherever they appear.
Thus, that implementation would require changes to make it parse different
array brackets in different ways.  This seems to counterbalance the benefit
of reducing Eclipse implementation burden.

This is why I am not in favor of this change that introduces a special case
into the Java grammar.


More information about the type-annotations-spec-experts mailing list