RFR: 8374749: Clarify AnnotationValue specification

Joe Darcy darcy at openjdk.org
Thu Jan 8 18:09:35 UTC 2026


On Thu, 8 Jan 2026 08:57:30 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Make the correspondence between AnnotationValue cases and the cases listed in JLS 9.6.1 more explicit.
>
> src/java.compiler/share/classes/javax/lang/model/element/AnnotationValue.java line 33:
> 
>> 31:  * <ul><li> a wrapper class, such as {@link Integer} to represent a primitive type
>> 32:  *     <li> {@code String} representing a {@code String}
>> 33:  *     <li> {@code TypeMirror} representing a {@code Class}
> 
> Shuld we call these string literal and class literal? JLS 3.10.5, 15.8.2

Hmm. The string value isn't necessarily a literal per se as the original value could be from a constant string-valued expression. Change "Class" to "Class literal" might be better; let me think about a bit.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29101#discussion_r2673356236


More information about the compiler-dev mailing list