Improvements to javac diagnostics (not an RFR yet)

Alex Buckley alex.buckley at
Thu Oct 3 17:30:56 PDT 2013

It sure would be easier to read if there were separate patches for, one per functional area (imports, annotations, 
annotation types, etc).

Some specific messages:

- compiler.err.invalid.repeatable.annotation.value.return: I don't know 
why the message says "duplicate annotation". Also, "containing 
annotation" should be "containing annotation type".

- compiler.err.duplicate.annotation.missing.containing.type: Also says 
"duplicate annotation" for no reason.

- compiler.err.invalid.repeatable.annotation.retention: "containing 
annotation" should be "containing annotation type". Also there's an 
unnecessary "retention" in the middle.

"containing annotation" should be "containing annotation type".

- compiler.err.intf.annotation.cant.have.type.params: mentions 
"annotation type" followed by an @ !

- compiler.err.intf.annotation.member.clash: ditto.

- should be 
"repeated" not "repeatable" in the key and message. I presume this error 
is about annotations, which are repeated, as opposed to being about 
annotation types, which are repeatable.

- Officially the term is 
"enhanced for loops" rather than "for-each loops".

FYI please link to the exact 01, 02, ... URL in future revisions.


On 10/3/2013 4:21 PM, Eric McCorkle wrote:
> This webrev has a set of changes to javac diagnostic messages to improve
> their readability and coherence with the JLS.
> Please look over them and make any suggestions for additional changes.
> Note that this is not a formal review request, and there are probably
> tests that will fail due to these changes.
> The webrev is here:

More information about the compiler-dev mailing list