JDK-8319428 : Start of release updates for JDK 23
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Priority: P4
  • Status: Draft
  • Resolution: Unresolved
  • Fix Versions: 23
  • Submitted: 2023-11-03
  • Updated: 2023-11-03
Related Reports
CSR :  
Relates :  
Description
Summary
-------
Update core libraries for JDK 23 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 ae1c48226ef..16c57a9463e 100644
    --- a/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java
    +++ b/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java
    @@ -294,6 +294,18 @@ public enum ClassFileFormatVersion {
          * <cite>The Java Virtual Machine Specification, Java SE 22 Edition</cite></a>
          */
         RELEASE_22(66),
    +
    +    /**
    +     * The version introduced by the Java Platform, Standard Edition
    +     * 23.
    +     *
    +     * @since 23
    +     *
    +     * @see <a
    +     * href="https://docs.oracle.com/javase/specs/jvms/se23/html/index.html">
    +     * <cite>The Java Virtual Machine Specification, Java SE 23 Edition</cite></a>
    +     */
    +    RELEASE_23(67),
         ; // Reduce code churn when appending new constants
     
         // Note to maintainers: when adding constants for newer releases,
    @@ -309,7 +321,7 @@ private ClassFileFormatVersion(int major) {
          * {@return the latest class file format version}
          */
         public static ClassFileFormatVersion latest() {
    -        return RELEASE_22;
    +        return RELEASE_23;
         }
     
         /**