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

Problem
-------

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

Solution
--------

Add the new constants. As a consequence of defining new constants, the behavior of the `ClassFile.latestMajorVersion()` and `ClassFileFormatVersion.latest()` methods is updated accordingly.

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


	diff --git 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
	@@ -1038,6 +1038,14 @@
	      */
	     int JAVA_26_VERSION = 70;
	 
	+    /**
	+     * The class major version introduced by Java SE 27, {@value}.
	+     *
	+     * @see ClassFileFormatVersion#RELEASE_27
	+     * @since 27
	+     */
	+    int JAVA_27_VERSION = 71;
	+
	     /**
	      * A minor version number {@value} indicating a class uses preview features
	      * of a Java SE release since 12, for major versions {@value
	@@ -1049,7 +1057,7 @@
	      * {@return the latest class major version supported by the current runtime}
	      */
	     static int latestMajorVersion() {
	-        return JAVA_26_VERSION;
	+        return JAVA_27_VERSION;
	     }
	 
	     /**
	diff --git 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	
	@@ -383,6 +383,18 @@
	      * <cite>The Java Virtual Machine Specification, Java SE 26 Edition</cite></a>
	      */
	     RELEASE_26(70),
	+
	+    /**
	+     * The version introduced by the Java Platform, Standard Edition
	+     * 27.
	+     *
	+     * @since 27
	+     *
	+     * @see <a
	+     * href="https://docs.oracle.com/javase/specs/jvms/se27/html/index.html">
	+     * <cite>The Java Virtual Machine Specification, Java SE 27 Edition</cite></a>
	+     */
	+    RELEASE_27(71),
	     ; // Reduce code churn when appending new constants
	 
	     // Note to maintainers: when adding constants for newer releases,
	@@ -398,7 +410,7 @@
	      * {@return the latest class file format version}
	      */
	     public static ClassFileFormatVersion latest() {
	-        return RELEASE_26;
	+        return RELEASE_27;
	     }
Comments
Serving as Reviewed By reviewer and moving to Approved. [~nbenalla], same note as in the other CSR to double-check the expected future URL of the JVMLS.
31-10-2025