JDK-8306628 : Start of release updates for JDK 22
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 22
  • Submitted: 2023-04-20
  • Updated: 2023-11-03
  • Resolved: 2023-05-10
Related Reports
CSR :  
Relates :  
Description
Summary
-------
Update core libraries for JDK 22 by adding an enum constant to `ClassFileFormatVersion`.

Problem
-------

With a new release, `ClassFileFormatVersion` needs a constant to model that release.

Solution
--------

Add the new constant.

Specification
-------------

    diff --git a/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java b/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java
    index 81ceaa96f50..192024d8344 100644
    --- a/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java
    +++ b/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java
    @@ -274,7 +274,19 @@ public enum ClassFileFormatVersion {
          * href="https://docs.oracle.com/javase/specs/jvms/se21/html/index.html">
          * <cite>The Java Virtual Machine Specification, Java SE 21 Edition</cite></a>
          */
    -    RELEASE_21(65);
    +    RELEASE_21(65),
    +
    +    /**
    +     * The version recognized by the Java Platform, Standard Edition
    +     * 22.
    +     *
    +     * @since 22
    +     *
    +     * @see <a
    +     * href="https://docs.oracle.com/javase/specs/jvms/se22/html/index.html">
    +     * <cite>The Java Virtual Machine Specification, Java SE 22 Edition</cite></a>
    +     */
    +    RELEASE_22(66);
     
         // Note to maintainers: when adding constants for newer releases,
         // the implementation of latest() must be updated too.
    @@ -289,7 +301,7 @@ public enum ClassFileFormatVersion {
          * {@return the latest class file format version}
          */
         public static ClassFileFormatVersion latest() {
    -        return RELEASE_21;
    +        return RELEASE_22;
         }
     
         /**


Comments
Moving to Approved.
10-05-2023