Recommended placement of type annotations

Markus Keller markus_keller at ch.ibm.com
Thu Feb 6 08:59:40 PST 2014


java-se-8-jls-fr-diffs.pdf says in 9.7.4: "It is customary, though not 
required, to place annotations before all other modifiers."
But that's not the tradition for type annotations.

The java-annotation-design.html said: "It is strongly recommended that 
type annotations be written immediately before the type, after declaration 
annotations and modifiers."

A more useful recommendation to alleviate the grammar problems is this:
=> "It is strongly recommended that declaration annotations be written 
before all other modifiers, and type annotations immediately before the 
type they apply to."

Regard,
Markus



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