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

0 commit comments

Comments
 (0)