8342979: Start of release updates for JDK 25

8342982: Add SourceVersion.RELEASE_25
8342983: Add source 25 and target 25 to javac

Co-authored-by: Joe Darcy <darcy@openjdk.org>
Reviewed-by: iris, darcy, erikj, dholmes
This commit is contained in:
Pavel Rappo 2024-12-05 17:03:27 +00:00
parent 85fedbf668
commit 5cc150c636
98 changed files with 6173 additions and 49 deletions

View file

@ -641,6 +641,12 @@ public sealed interface ClassFile
/** The class major version of JAVA_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
@ -652,7 +658,7 @@ public sealed interface ClassFile
* {@return the latest major Java version}
*/
static int latestMajorVersion() {
return JAVA_24_VERSION;
return JAVA_25_VERSION;
}
/**

View file

@ -318,6 +318,18 @@ public enum ClassFileFormatVersion {
* <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,
@ -333,7 +345,7 @@ public enum ClassFileFormatVersion {
* {@return the latest class file format version}
*/
public static ClassFileFormatVersion latest() {
return RELEASE_24;
return RELEASE_25;
}
/**

View file

@ -227,7 +227,7 @@ public class ClassReader {
this.b = classFileBuffer;
// Check the class' major_version. This field is after the magic and minor_version fields, which
// use 4 and 2 bytes respectively.
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V24) {
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V25) {
throw new IllegalArgumentException(
"Unsupported class file major version " + readShort(classFileOffset + 6));
}

View file

@ -314,6 +314,7 @@ public interface Opcodes {
int V22 = 0 << 16 | 66;
int V23 = 0 << 16 | 67;
int V24 = 0 << 16 | 68;
int V25 = 0 << 16 | 69;
/**
* Version flag indicating that the class is using 'preview' features.