Skip to content

Commit 75dc2f8

Browse files
jddarcyJesperIRL
authored andcommitted
8330182: Start of release updates for JDK 24
8330183: Add SourceVersion.RELEASE_24 8330184: Add source 24 and target 24 to javac Reviewed-by: iris, vromero, asotona, dholmes
1 parent 054362a commit 75dc2f8

File tree

50 files changed

+2076
-64
lines changed

Some content is hidden

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

50 files changed

+2076
-64
lines changed

.jcheck/conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[general]
22
project=jdk
33
jbs=JDK
4-
version=23
4+
version=24
55

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

make/conf/version-numbers.conf

Lines changed: 5 additions & 5 deletions
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=23
29+
DEFAULT_VERSION_FEATURE=24
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=2024-09-17
37-
DEFAULT_VERSION_CLASSFILE_MAJOR=67 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
36+
DEFAULT_VERSION_DATE=2025-03-18
37+
DEFAULT_VERSION_CLASSFILE_MAJOR=68 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
3838
DEFAULT_VERSION_CLASSFILE_MINOR=0
3939
DEFAULT_VERSION_DOCS_API_SINCE=11
40-
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="22 23"
41-
DEFAULT_JDK_SOURCE_TARGET_VERSION=23
40+
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="22 23 24"
41+
DEFAULT_JDK_SOURCE_TARGET_VERSION=24
4242
DEFAULT_PROMOTED_VERSION_PRE=ea

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@
151151

152152
#define JAVA_23_VERSION 67
153153

154+
#define JAVA_24_VERSION 68
155+
154156
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
155157
assert((bad_constant == JVM_CONSTANT_Module ||
156158
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,6 +1481,12 @@ default List<VerifyError> verify(Path path) throws IOException {
14811481
*/
14821482
int JAVA_23_VERSION = 67;
14831483

1484+
/**
1485+
* The class major version of JAVA_24.
1486+
* @since 24
1487+
*/
1488+
int JAVA_24_VERSION = 68;
1489+
14841490
/**
14851491
* A minor version number indicating a class uses preview features
14861492
* of a Java SE version since 12, for major versions {@value
@@ -1492,7 +1498,7 @@ default List<VerifyError> verify(Path path) throws IOException {
14921498
* {@return the latest major Java version}
14931499
*/
14941500
static int latestMajorVersion() {
1495-
return JAVA_23_VERSION;
1501+
return JAVA_24_VERSION;
14961502
}
14971503

14981504
/**

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -306,6 +306,18 @@ public enum ClassFileFormatVersion {
306306
* <cite>The Java Virtual Machine Specification, Java SE 23 Edition</cite></a>
307307
*/
308308
RELEASE_23(67),
309+
310+
/**
311+
* The version introduced by the Java Platform, Standard Edition
312+
* 24.
313+
*
314+
* @since 24
315+
*
316+
* @see <a
317+
* href="https://docs.oracle.com/javase/specs/jvms/se24/html/index.html">
318+
* <cite>The Java Virtual Machine Specification, Java SE 24 Edition</cite></a>
319+
*/
320+
RELEASE_24(68),
309321
; // Reduce code churn when appending new constants
310322

311323
// Note to maintainers: when adding constants for newer releases,
@@ -321,7 +333,7 @@ private ClassFileFormatVersion(int major) {
321333
* {@return the latest class file format version}
322334
*/
323335
public static ClassFileFormatVersion latest() {
324-
return RELEASE_23;
336+
return RELEASE_24;
325337
}
326338

327339
/**

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

Lines changed: 1 addition & 1 deletion
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.V23) {
230+
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V24) {
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ public interface Opcodes {
313313
int V21 = 0 << 16 | 65;
314314
int V22 = 0 << 16 | 66;
315315
int V23 = 0 << 16 | 67;
316+
int V24 = 0 << 16 | 68;
316317

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

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -427,6 +427,18 @@ public enum SourceVersion {
427427
* <cite>The Java Language Specification, Java SE 23 Edition</cite></a>
428428
*/
429429
RELEASE_23,
430+
431+
/**
432+
* The version introduced by the Java Platform, Standard Edition
433+
* 24.
434+
*
435+
* @since 24
436+
*
437+
* @see <a
438+
* href="https://docs.oracle.com/javase/specs/jls/se24/html/index.html">
439+
* <cite>The Java Language Specification, Java SE 24 Edition</cite></a>
440+
*/
441+
RELEASE_24,
430442
; // Reduce code churn when appending new constants
431443

432444
// Note that when adding constants for newer releases, the
@@ -436,7 +448,7 @@ public enum SourceVersion {
436448
* {@return the latest source version that can be modeled}
437449
*/
438450
public static SourceVersion latest() {
439-
return RELEASE_23;
451+
return RELEASE_24;
440452
}
441453

442454
private static final SourceVersion latestSupported = getLatestSupported();
@@ -451,7 +463,7 @@ public static SourceVersion latest() {
451463
private static SourceVersion getLatestSupported() {
452464
int intVersion = Runtime.version().feature();
453465
return (intVersion >= 11) ?
454-
valueOf("RELEASE_" + Math.min(23, intVersion)):
466+
valueOf("RELEASE_" + Math.min(24, intVersion)):
455467
RELEASE_10;
456468
}
457469

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

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

5050
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* @see AbstractAnnotationValueVisitor14
5252
* @since 23
5353
*/
54-
@SupportedSourceVersion(RELEASE_23)
54+
@SupportedSourceVersion(RELEASE_24)
5555
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
5656
public abstract class AbstractAnnotationValueVisitorPreview<R, P> extends AbstractAnnotationValueVisitor14<R, P> {
5757

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* @see AbstractElementVisitor9
5151
* @since 16
5252
*/
53-
@SupportedSourceVersion(RELEASE_23)
53+
@SupportedSourceVersion(RELEASE_24)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* @see AbstractElementVisitor14
5757
* @since 23
5858
*/
59-
@SupportedSourceVersion(RELEASE_23)
59+
@SupportedSourceVersion(RELEASE_24)
6060
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
6161
public abstract class AbstractElementVisitorPreview<R, P> extends AbstractElementVisitor14<R, P> {
6262
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* @see AbstractTypeVisitor9
4848
* @since 14
4949
*/
50-
@SupportedSourceVersion(RELEASE_23)
50+
@SupportedSourceVersion(RELEASE_24)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* @see AbstractTypeVisitor14
5555
* @since 23
5656
*/
57-
@SupportedSourceVersion(RELEASE_23)
57+
@SupportedSourceVersion(RELEASE_24)
5858
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
5959
public abstract class AbstractTypeVisitorPreview<R, P> extends AbstractTypeVisitor14<R, P> {
6060
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* @see ElementKindVisitor9
6262
* @since 16
6363
*/
64-
@SupportedSourceVersion(RELEASE_23)
64+
@SupportedSourceVersion(RELEASE_24)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
* @see ElementKindVisitor14
6969
* @since 23
7070
*/
71-
@SupportedSourceVersion(RELEASE_23)
71+
@SupportedSourceVersion(RELEASE_24)
7272
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
7373
public class ElementKindVisitorPreview<R, P> extends ElementKindVisitor14<R, P> {
7474
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
* @see ElementScanner9
7979
* @since 16
8080
*/
81-
@SupportedSourceVersion(RELEASE_23)
81+
@SupportedSourceVersion(RELEASE_24)
8282
public class ElementScanner14<R, P> extends ElementScanner9<R, P> {
8383
/**
8484
* Constructor for concrete subclasses; uses {@code null} for the

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
* @see ElementScanner14
8686
* @since 23
8787
*/
88-
@SupportedSourceVersion(RELEASE_23)
88+
@SupportedSourceVersion(RELEASE_24)
8989
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
9090
public class ElementScannerPreview<R, P> extends ElementScanner14<R, P> {
9191
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
* @see SimpleAnnotationValueVisitor9
5353
* @since 14
5454
*/
55-
@SupportedSourceVersion(RELEASE_23)
55+
@SupportedSourceVersion(RELEASE_24)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
* @see SimpleAnnotationValueVisitor14
6060
* @since 23
6161
*/
62-
@SupportedSourceVersion(RELEASE_23)
62+
@SupportedSourceVersion(RELEASE_24)
6363
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
6464
public class SimpleAnnotationValueVisitorPreview<R, P> extends SimpleAnnotationValueVisitor14<R, P> {
6565
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
* @see SimpleElementVisitor9
5959
* @since 16
6060
*/
61-
@SupportedSourceVersion(RELEASE_23)
61+
@SupportedSourceVersion(RELEASE_24)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
* @see SimpleElementVisitor14
6565
* @since 23
6666
*/
67-
@SupportedSourceVersion(RELEASE_23)
67+
@SupportedSourceVersion(RELEASE_24)
6868
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
6969
public class SimpleElementVisitorPreview<R, P> extends SimpleElementVisitor14<R, P> {
7070
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* @see SimpleTypeVisitor9
5757
* @since 14
5858
*/
59-
@SupportedSourceVersion(RELEASE_23)
59+
@SupportedSourceVersion(RELEASE_24)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
* @see SimpleTypeVisitor14
6464
* @since 23
6565
*/
66-
@SupportedSourceVersion(RELEASE_23)
66+
@SupportedSourceVersion(RELEASE_24)
6767
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
6868
public class SimpleTypeVisitorPreview<R, P> extends SimpleTypeVisitor14<R, P> {
6969
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* @see TypeKindVisitor9
6262
* @since 14
6363
*/
64-
@SupportedSourceVersion(RELEASE_23)
64+
@SupportedSourceVersion(RELEASE_24)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* @see TypeKindVisitor14
6868
* @since 23
6969
*/
70-
@SupportedSourceVersion(RELEASE_23)
70+
@SupportedSourceVersion(RELEASE_24)
7171
@PreviewFeature(feature=PreviewFeature.Feature.LANGUAGE_MODEL, reflective=true)
7272
public class TypeKindVisitorPreview<R, P> extends TypeKindVisitor14<R, P> {
7373
/**

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ public enum Source {
143143
* 23, tbd
144144
*/
145145
JDK23("23"),
146+
147+
/**
148+
* 24, tbd
149+
*/
150+
JDK24("24"),
146151
; // Reduce code churn when appending new constants
147152

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

196201
public Target requiredTarget() {
197202
return switch(this) {
203+
case JDK24 -> Target.JDK1_24;
198204
case JDK23 -> Target.JDK1_23;
199205
case JDK22 -> Target.JDK1_22;
200206
case JDK21 -> Target.JDK1_21;
@@ -341,6 +347,7 @@ public static SourceVersion toSourceVersion(Source source) {
341347
case JDK21 -> RELEASE_21;
342348
case JDK22 -> RELEASE_22;
343349
case JDK23 -> RELEASE_23;
350+
case JDK24 -> RELEASE_24;
344351
default -> null;
345352
};
346353
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -126,6 +126,7 @@ public enum Version {
126126
V65(65, 0), // JDK 21
127127
V66(66, 0), // JDK 22
128128
V67(67, 0), // JDK 23
129+
V68(68, 0), // JDK 24
129130
; // Reduce code churn when appending new constants
130131
Version(int major, int minor) {
131132
this.major = major;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -104,6 +104,9 @@ public enum Target {
104104

105105
/** JDK 23. */
106106
JDK1_23("23", 67, 0),
107+
108+
/** JDK 24. */
109+
JDK1_24("24", 68, 0),
107110
; // Reduce code churn when appending new constants
108111

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,7 @@
5555
* deletion without notice.</b>
5656
*/
5757
@SupportedAnnotationTypes("*")
58-
@SupportedSourceVersion(SourceVersion.RELEASE_23)
58+
@SupportedSourceVersion(SourceVersion.RELEASE_24)
5959
public class PrintingProcessor extends AbstractProcessor {
6060
PrintWriter writer;
6161

0 commit comments

Comments
 (0)