JDK-8343029 : Start of release updates for JDK 25
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 25
  • Submitted: 2024-10-25
  • Updated: 2024-10-25
  • Resolved: 2024-10-25
Related Reports
CSR :  
Relates :  
Description
Summary
-------
Update core libraries for JDK 24 by adding an enum constant to `ClassFileFormatVersion` and a constant to `ClassFile`.

Problem
-------

With a new release, `ClassFileFormatVersion` and `ClassFile` need a constants to model that release.

Solution
--------

Add the new constants.

Specification
-------------
    diff a/src/java.base/share/classes/java/lang/classfile/ClassFile.java b/src/java.base/share/classes/java/lang/classfile/ClassFile.java
    --- a/src/java.base/share/classes/java/lang/classfile/ClassFile.java
    +++ b/src/java.base/share/classes/java/lang/classfile/ClassFile.java
    @@ -658,10 +658,16 @@
          * The class major version of JAVA_24.
          * @since 24
          */
         int JAVA_24_VERSION = 68;
     
    +    /**
    +     * The class major version of JAVA_25.
    +     * @since 25
    +     */
    +    int JAVA_25_VERSION = 69;
    +
         /**
          * A minor version number indicating a class uses preview features
          * of a Java SE version since 12, for major versions {@value
          * #JAVA_12_VERSION} and above.
          */
    @@ -669,11 +675,11 @@
     
         /**
          * {@return the latest major Java version}
          */
         static int latestMajorVersion() {
    -        return JAVA_24_VERSION;
    +        return JAVA_25_VERSION;
         }
     
         /**
          * {@return the latest minor Java version}
          */
    diff a/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java b/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java
    --- a/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java
    +++ b/src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java
    @@ -316,10 +316,22 @@
          * @see <a
          * href="https://docs.oracle.com/javase/specs/jvms/se24/html/index.html">
          * <cite>The Java Virtual Machine Specification, Java SE 24 Edition</cite></a>
          */
         RELEASE_24(68),
    +
    +    /**
    +     * The version introduced by the Java Platform, Standard Edition
    +     * 25.
    +     *
    +     * @since 25
    +     *
    +     * @see <a
    +     * href="https://docs.oracle.com/javase/specs/jvms/se25/html/index.html">
    +     * <cite>The Java Virtual Machine Specification, Java SE 25 Edition</cite></a>
    +     */
    +    RELEASE_25(69),
         ; // Reduce code churn when appending new constants
     
         // Note to maintainers: when adding constants for newer releases,
         // the implementation of latest() must be updated too.
     
    @@ -331,11 +343,11 @@
     
         /**
          * {@return the latest class file format version}
          */
         public static ClassFileFormatVersion latest() {
    -        return RELEASE_24;
    +        return RELEASE_25;
         }
     
         /**
          * {@return the major class file version as an integer}
          * @jvms 4.1 The {@code ClassFile} Structure

 


Comments
Moving to Approved.
25-10-2024

Looks good. Reviewed and fixed a format issue.
25-10-2024