RFR: 8336754: Remodel TypeAnnotation to "has" instead of "be" an Annotation

Chen Liang liach at openjdk.org
Fri Jul 19 13:48:33 UTC 2024


On Fri, 19 Jul 2024 13:30:44 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> `TypeAnnotation` is not an annotation, as it should not be used in places like `AnnotationValue.ofAnnotation`. Thus it's remodeled to contain an annotation at a given location instead of to be an annotation.
>> 
>> Depends on #20205.
>
> src/java.base/share/classes/jdk/internal/classfile/impl/AnnotationReader.java line 302:
> 
>> 300:     }
>> 301: 
>> 302:     public static void writeTypeAnnotation(BufWriterImpl buf, TypeAnnotation ta) {
> 
> Is there any reason to move writeTypeAnnotation from UnboundAttribute?

This is for consistency with reading annotations: they are now defined in the same file.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20247#discussion_r1684409764


More information about the core-libs-dev mailing list