Skip to content

Commit 5cc150c

Browse files
Pavel Rappojddarcy
Pavel Rappo
andcommitted
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
1 parent 85fedbf commit 5cc150c

File tree

98 files changed

+6173
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+6173
-49
lines changed

.jcheck/conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[general]
22
project=jdk
33
jbs=JDK
4-
version=24
4+
version=25
55

66
[checks]
77
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists

make/conf/version-numbers.conf

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
# Default version, product, and vendor information to use,
2727
# unless overridden by configure
2828

29-
DEFAULT_VERSION_FEATURE=24
29+
DEFAULT_VERSION_FEATURE=25
3030
DEFAULT_VERSION_INTERIM=0
3131
DEFAULT_VERSION_UPDATE=0
3232
DEFAULT_VERSION_PATCH=0
3333
DEFAULT_VERSION_EXTRA1=0
3434
DEFAULT_VERSION_EXTRA2=0
3535
DEFAULT_VERSION_EXTRA3=0
36-
DEFAULT_VERSION_DATE=2025-03-18
37-
DEFAULT_VERSION_CLASSFILE_MAJOR=68 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
36+
DEFAULT_VERSION_DATE=2025-09-16
37+
DEFAULT_VERSION_CLASSFILE_MAJOR=69 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
3838
DEFAULT_VERSION_CLASSFILE_MINOR=0
3939
DEFAULT_VERSION_DOCS_API_SINCE=11
40-
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="23 24"
41-
DEFAULT_JDK_SOURCE_TARGET_VERSION=24
40+
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="23 24 25"
41+
DEFAULT_JDK_SOURCE_TARGET_VERSION=25
4242
DEFAULT_PROMOTED_VERSION_PRE=ea

src/hotspot/share/classfile/classFileParser.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@
153153

154154
#define JAVA_24_VERSION 68
155155

156+
#define JAVA_25_VERSION 69
157+
156158
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
157159
assert((bad_constant == JVM_CONSTANT_Module ||
158160
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,

src/java.base/share/classes/java/lang/classfile/ClassFile.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,12 @@ default List<VerifyError> verify(Path path) throws IOException {
641641
/** The class major version of JAVA_24. */
642642
int JAVA_24_VERSION = 68;
643643

644+
/**
645+
* The class major version of JAVA_25.
646+
* @since 25
647+
*/
648+
int JAVA_25_VERSION = 69;
649+
644650
/**
645651
* A minor version number indicating a class uses preview features
646652
* of a Java SE version since 12, for major versions {@value
@@ -652,7 +658,7 @@ default List<VerifyError> verify(Path path) throws IOException {
652658
* {@return the latest major Java version}
653659
*/
654660
static int latestMajorVersion() {
655-
return JAVA_24_VERSION;
661+
return JAVA_25_VERSION;
656662
}
657663

658664
/**

src/java.base/share/classes/java/lang/reflect/ClassFileFormatVersion.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,18 @@ public enum ClassFileFormatVersion {
318318
* <cite>The Java Virtual Machine Specification, Java SE 24 Edition</cite></a>
319319
*/
320320
RELEASE_24(68),
321+
322+
/**
323+
* The version introduced by the Java Platform, Standard Edition
324+
* 25.
325+
*
326+
* @since 25
327+
*
328+
* @see <a
329+
* href="https://docs.oracle.com/javase/specs/jvms/se25/html/index.html">
330+
* <cite>The Java Virtual Machine Specification, Java SE 25 Edition</cite></a>
331+
*/
332+
RELEASE_25(69),
321333
; // Reduce code churn when appending new constants
322334

323335
// Note to maintainers: when adding constants for newer releases,
@@ -333,7 +345,7 @@ private ClassFileFormatVersion(int major) {
333345
* {@return the latest class file format version}
334346
*/
335347
public static ClassFileFormatVersion latest() {
336-
return RELEASE_24;
348+
return RELEASE_25;
337349
}
338350

339351
/**

src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java

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

src/java.base/share/classes/jdk/internal/org/objectweb/asm/Opcodes.java

+1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ public interface Opcodes {
314314
int V22 = 0 << 16 | 66;
315315
int V23 = 0 << 16 | 67;
316316
int V24 = 0 << 16 | 68;
317+
int V25 = 0 << 16 | 69;
317318

318319
/**
319320
* Version flag indicating that the class is using 'preview' features.

src/java.compiler/share/classes/javax/lang/model/SourceVersion.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,18 @@ public enum SourceVersion {
444444
* <cite>The Java Language Specification, Java SE 24 Edition</cite></a>
445445
*/
446446
RELEASE_24,
447+
448+
/**
449+
* The version introduced by the Java Platform, Standard Edition
450+
* 25.
451+
*
452+
* @since 25
453+
*
454+
* @see <a
455+
* href="https://docs.oracle.com/javase/specs/jls/se25/html/index.html">
456+
* <cite>The Java Language Specification, Java SE 25 Edition</cite></a>
457+
*/
458+
RELEASE_25,
447459
; // Reduce code churn when appending new constants
448460

449461
// Note that when adding constants for newer releases, the
@@ -453,7 +465,7 @@ public enum SourceVersion {
453465
* {@return the latest source version that can be modeled}
454466
*/
455467
public static SourceVersion latest() {
456-
return RELEASE_24;
468+
return RELEASE_25;
457469
}
458470

459471
private static final SourceVersion latestSupported = getLatestSupported();
@@ -468,7 +480,7 @@ public static SourceVersion latest() {
468480
private static SourceVersion getLatestSupported() {
469481
int intVersion = Runtime.version().feature();
470482
return (intVersion >= 11) ?
471-
valueOf("RELEASE_" + Math.min(24, intVersion)):
483+
valueOf("RELEASE_" + Math.min(25, intVersion)):
472484
RELEASE_10;
473485
}
474486

src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* @see AbstractAnnotationValueVisitor9
4545
* @since 14
4646
*/
47-
@SupportedSourceVersion(RELEASE_24)
47+
@SupportedSourceVersion(RELEASE_25)
4848
public abstract class AbstractAnnotationValueVisitor14<R, P> extends AbstractAnnotationValueVisitor9<R, P> {
4949

5050
/**

src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitorPreview.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* @see AbstractAnnotationValueVisitor14
5151
* @since 23
5252
*/
53-
@SupportedSourceVersion(RELEASE_24)
53+
@SupportedSourceVersion(RELEASE_25)
5454
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
5555
public abstract class AbstractAnnotationValueVisitorPreview<R, P> extends AbstractAnnotationValueVisitor14<R, P> {
5656

src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* @see AbstractElementVisitor9
5151
* @since 16
5252
*/
53-
@SupportedSourceVersion(RELEASE_24)
53+
@SupportedSourceVersion(RELEASE_25)
5454
public abstract class AbstractElementVisitor14<R, P> extends AbstractElementVisitor9<R, P> {
5555
/**
5656
* Constructor for concrete subclasses to call.

src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitorPreview.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* @see AbstractElementVisitor14
5454
* @since 23
5555
*/
56-
@SupportedSourceVersion(RELEASE_24)
56+
@SupportedSourceVersion(RELEASE_25)
5757
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
5858
public abstract class AbstractElementVisitorPreview<R, P> extends AbstractElementVisitor14<R, P> {
5959
/**

src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* @see AbstractTypeVisitor9
4848
* @since 14
4949
*/
50-
@SupportedSourceVersion(RELEASE_24)
50+
@SupportedSourceVersion(RELEASE_25)
5151
public abstract class AbstractTypeVisitor14<R, P> extends AbstractTypeVisitor9<R, P> {
5252
/**
5353
* Constructor for concrete subclasses to call.

src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitorPreview.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* @see AbstractTypeVisitor14
5454
* @since 23
5555
*/
56-
@SupportedSourceVersion(RELEASE_24)
56+
@SupportedSourceVersion(RELEASE_25)
5757
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
5858
public abstract class AbstractTypeVisitorPreview<R, P> extends AbstractTypeVisitor14<R, P> {
5959
/**

src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* @see ElementKindVisitor9
6262
* @since 16
6363
*/
64-
@SupportedSourceVersion(RELEASE_24)
64+
@SupportedSourceVersion(RELEASE_25)
6565
public class ElementKindVisitor14<R, P> extends ElementKindVisitor9<R, P> {
6666
/**
6767
* Constructor for concrete subclasses; uses {@code null} for the

src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitorPreview.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* @see ElementKindVisitor14
6868
* @since 23
6969
*/
70-
@SupportedSourceVersion(RELEASE_24)
70+
@SupportedSourceVersion(RELEASE_25)
7171
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
7272
public class ElementKindVisitorPreview<R, P> extends ElementKindVisitor14<R, P> {
7373
/**

src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
* @see ElementScanner9
7878
* @since 16
7979
*/
80-
@SupportedSourceVersion(RELEASE_24)
80+
@SupportedSourceVersion(RELEASE_25)
8181
public class ElementScanner14<R, P> extends ElementScanner9<R, P> {
8282
/**
8383
* Constructor for concrete subclasses; uses {@code null} for the

src/java.compiler/share/classes/javax/lang/model/util/ElementScannerPreview.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
* @see ElementScanner14
8282
* @since 23
8383
*/
84-
@SupportedSourceVersion(RELEASE_24)
84+
@SupportedSourceVersion(RELEASE_25)
8585
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
8686
public class ElementScannerPreview<R, P> extends ElementScanner14<R, P> {
8787
/**

src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
* @see SimpleAnnotationValueVisitor9
5353
* @since 14
5454
*/
55-
@SupportedSourceVersion(RELEASE_24)
55+
@SupportedSourceVersion(RELEASE_25)
5656
public class SimpleAnnotationValueVisitor14<R, P> extends SimpleAnnotationValueVisitor9<R, P> {
5757
/**
5858
* Constructor for concrete subclasses; uses {@code null} for the

src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitorPreview.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
* @see SimpleAnnotationValueVisitor14
5959
* @since 23
6060
*/
61-
@SupportedSourceVersion(RELEASE_24)
61+
@SupportedSourceVersion(RELEASE_25)
6262
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
6363
public class SimpleAnnotationValueVisitorPreview<R, P> extends SimpleAnnotationValueVisitor14<R, P> {
6464
/**

src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
* @see SimpleElementVisitor9
5959
* @since 16
6060
*/
61-
@SupportedSourceVersion(RELEASE_24)
61+
@SupportedSourceVersion(RELEASE_25)
6262
public class SimpleElementVisitor14<R, P> extends SimpleElementVisitor9<R, P> {
6363
/**
6464
* Constructor for concrete subclasses; uses {@code null} for the

src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitorPreview.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* @see SimpleElementVisitor14
6262
* @since 23
6363
*/
64-
@SupportedSourceVersion(RELEASE_24)
64+
@SupportedSourceVersion(RELEASE_25)
6565
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
6666
public class SimpleElementVisitorPreview<R, P> extends SimpleElementVisitor14<R, P> {
6767
/**

src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* @see SimpleTypeVisitor9
5757
* @since 14
5858
*/
59-
@SupportedSourceVersion(RELEASE_24)
59+
@SupportedSourceVersion(RELEASE_25)
6060
public class SimpleTypeVisitor14<R, P> extends SimpleTypeVisitor9<R, P> {
6161
/**
6262
* Constructor for concrete subclasses; uses {@code null} for the

src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitorPreview.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
* @see SimpleTypeVisitor14
6363
* @since 23
6464
*/
65-
@SupportedSourceVersion(RELEASE_24)
65+
@SupportedSourceVersion(RELEASE_25)
6666
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
6767
public class SimpleTypeVisitorPreview<R, P> extends SimpleTypeVisitor14<R, P> {
6868
/**

src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* @see TypeKindVisitor9
6262
* @since 14
6363
*/
64-
@SupportedSourceVersion(RELEASE_24)
64+
@SupportedSourceVersion(RELEASE_25)
6565
public class TypeKindVisitor14<R, P> extends TypeKindVisitor9<R, P> {
6666
/**
6767
* Constructor for concrete subclasses to call; uses {@code null}

src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitorPreview.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* @see TypeKindVisitor14
6767
* @since 23
6868
*/
69-
@SupportedSourceVersion(RELEASE_24)
69+
@SupportedSourceVersion(RELEASE_25)
7070
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
7171
public class TypeKindVisitorPreview<R, P> extends TypeKindVisitor14<R, P> {
7272
/**

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java

+7
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ public enum Source {
148148
* 24, tbd
149149
*/
150150
JDK24("24"),
151+
152+
/**
153+
* 25, tbd
154+
*/
155+
JDK25("25"),
151156
; // Reduce code churn when appending new constants
152157

153158
private static final Context.Key<Source> sourceKey = new Context.Key<>();
@@ -200,6 +205,7 @@ public boolean isSupported() {
200205

201206
public Target requiredTarget() {
202207
return switch(this) {
208+
case JDK25 -> Target.JDK1_25;
203209
case JDK24 -> Target.JDK1_24;
204210
case JDK23 -> Target.JDK1_23;
205211
case JDK22 -> Target.JDK1_22;
@@ -351,6 +357,7 @@ public static SourceVersion toSourceVersion(Source source) {
351357
case JDK22 -> RELEASE_22;
352358
case JDK23 -> RELEASE_23;
353359
case JDK24 -> RELEASE_24;
360+
case JDK25 -> RELEASE_25;
354361
default -> null;
355362
};
356363
}

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public enum Version {
128128
V66(66, 0), // JDK 22
129129
V67(67, 0), // JDK 23
130130
V68(68, 0), // JDK 24
131+
V69(69, 0), // JDK 25
131132
; // Reduce code churn when appending new constants
132133
Version(int major, int minor) {
133134
this.major = major;

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ public enum Target {
107107

108108
/** JDK 24. */
109109
JDK1_24("24", 68, 0),
110+
111+
/** JDK 25. */
112+
JDK1_25("25", 69, 0),
110113
; // Reduce code churn when appending new constants
111114

112115
private static final Context.Key<Target> targetKey = new Context.Key<>();

src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* deletion without notice.</b>
5656
*/
5757
@SupportedAnnotationTypes("*")
58-
@SupportedSourceVersion(SourceVersion.RELEASE_24)
58+
@SupportedSourceVersion(SourceVersion.RELEASE_25)
5959
public class PrintingProcessor extends AbstractProcessor {
6060
PrintWriter writer;
6161

0 commit comments

Comments
 (0)