[type-annos-observers] formatting of annotated array types

Alex Buckley alex.buckley at oracle.com
Wed Nov 6 11:42:09 PST 2013


OK. Also I changed @X to @Foo in the JVMS chapter.

On 11/6/2013 11:10 AM, Markus Keller wrote:
> I know that coding conventions used by examples in the JLS are not
> normative, but a consistent notation is nonetheless helpful.
>
> JLS7 consistently uses a terse array type notation without any spaces
> between the type and the brackets, e.g. int[][] or Class<?>[].
>
> java-annotation-design.html and 308.pdf usually keep the terse notation,
> but add a space on both sides of an interspersed type annotation. These
> spaces are not enforced by the grammar, but I agree they improve
> readability.
>
> Could this style be used consistently in the code examples? 2013-10-24
> only needs corrections in two places:
>
> 308.pdf:  int [] @Foo [] f;
> expected: int[] @Foo [] f;
>
> 308.pdf:  @X String [] []
>            String @X [] []
>            String [] @X []
>
> expected: @X String[][]
>            String @X [][]
>            String[] @X []
>
> Thanks,
> Markus
>


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