RFR: JDK-8296149: Start of release updates for JDK 21

Joe Darcy darcy at openjdk.org
Tue Nov 29 05:15:25 UTC 2022


On Tue, 29 Nov 2022 04:45:57 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Usual start-of-release updates. Symbol updates in initial version reflect JDK 20 build 21.
>
> src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor14.java line 47:
> 
>> 45:  * @since 14
>> 46:  */
>> 47: @SupportedSourceVersion(RELEASE_21)
> 
> It is a pity these have to be updated each release. Is there no way to say `latest` here?

Not with the current language specification, no.

The only enum value "constant-enough" to use in an annotation is the name of an enum constant, a public static final field assigned an enum value is not enough.

On the flip side, I make the updates to these annotations using a one-line sed script I have saved away in a comment on one of the previous start-of-release-updates-for-JDK-N bugs. Using the annotations in this way is in lieu of adding another type specification for the JDK version. In other words, having AbstractAnnotationValueVisitor**14**.java with an annotation indicating RELEASE_21 prevents having AbstractAnnotationValueVisitor15, AbstractAnnotationValueVisitor16, ... , AbstractAnnotationValueVisitor21.

New visitors are now only introduced when adding new kinds of structures requires differences in behavior.

Thanks for the review.

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

PR: https://git.openjdk.org/jdk/pull/10924


More information about the compiler-dev mailing list