RFR: 8325433: Type annotations on primitive types are not linked [v2]
Guoxiong Li
gli at openjdk.org
Mon Mar 11 13:48:55 UTC 2024
On Mon, 11 Mar 2024 13:31:06 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Please review this patch that fixes the issue where type annotations on primitive types are not linked.
>>
>> Tested with file https://cr.openjdk.org/~liach/8325433-arrayanno/ArrayAnno.java
>>
>> import java.lang.annotation.*;
>>
>> public class ArrayAnno {
>> @Retention(RetentionPolicy.RUNTIME)
>> @Target(ElementType.TYPE_USE)
>> @Documented
>> public @interface Anno { int value(); }
>>
>> public void method(@Anno(1) int @Anno(2) [] @Anno(3) [] arg) {}
>> public void method(@Anno(1) String @Anno(2) [] @Anno(3) [] arg) {}
>> }
>>
>> JDK 21: https://cr.openjdk.org/~liach/8325433-arrayanno/old/ArrayAnno.html
>> This patch: https://cr.openjdk.org/~liach/8325433-arrayanno/new/ArrayAnno.html
>>
>> Note that a bug within javac (reported in https://bugs.openjdk.org/browse/JDK-8327824) causes the annotations to become `@Anno(1) String @Anno(3) [] @Anno(2) []` in the output files; this bug also affects output class files so I assume this is a bug within javac's tree building. (Intersting, the buggy javadoc output was copied wholesale in the original `TestTypeAnnotations` output for `array2Deep` cases, but no one paid attention to it)
>
> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>
> Removed unused methods
Changes requested by gli (Committer).
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkFactory.java line 31:
> 29: import java.util.EnumSet;
> 30: import java.util.List;
> 31: import java.util.Locale;
I can't find the code which uses `Locale`. Is it redundant?
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlLinkFactory.java line 41:
> 39: import javax.lang.model.type.ArrayType;
> 40: import javax.lang.model.type.DeclaredType;
> 41: import javax.lang.model.type.PrimitiveType;
`PrimitiveType` seems redundant as above.
-------------
PR Review: https://git.openjdk.org/jdk/pull/18179#pullrequestreview-1927874148
PR Review Comment: https://git.openjdk.org/jdk/pull/18179#discussion_r1519746786
PR Review Comment: https://git.openjdk.org/jdk/pull/18179#discussion_r1519747314
More information about the javadoc-dev
mailing list