RFR: 8327824: Type annotation placed on incorrect array nesting levels

Pavel Rappo prappo at openjdk.org
Tue Mar 12 12:01:15 UTC 2024


On Tue, 12 Mar 2024 03:33:38 GMT, Chen Liang <liach at openjdk.org> wrote:

> Please review this patch that fixes placement of type annotations on array types in Javadoc output. This oversight seems to have existed since JDK 8 but was never noticed or reported.

I've read your discussion with @cushon in the comment section for [the bug](https://bugs.openjdk.org/browse/JDK-8327824) and I agree that type annotations on arrays are unintuitive. Welp, we should make sure they are documented correctly.

Do you know if there's a test that exercises this particularly surprising bit from [Example 10.2-2. Array Variables and Array Types](https://docs.oracle.com/javase/specs/jls/se21/html/jls-10.html#d5e20110)?

> And perhaps surprisingly, the following field declarations have the same array type:
>
>     int @A [] f @B [];
>     int @B [] @A [] g;

If there isn't, we should add it.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18211#issuecomment-1991487157


More information about the javadoc-dev mailing list