Skip to content

Commit 175e3d3

Browse files
jddarcyJesperIRL
authored andcommitted
8296149: Start of release updates for JDK 21
8296150: Add SourceVersion.RELEASE_21 8296151: Add source 21 and target 21 to javac Reviewed-by: dholmes, iris, erikj, vromero, jlahoda
1 parent d562d3f commit 175e3d3

File tree

70 files changed

+5338
-54
lines changed

Some content is hidden

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

70 files changed

+5338
-54
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=20
4+
version=21
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=20
29+
DEFAULT_VERSION_FEATURE=21
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=2023-03-21
37-
DEFAULT_VERSION_CLASSFILE_MAJOR=64 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
36+
DEFAULT_VERSION_DATE=2023-09-19
37+
DEFAULT_VERSION_CLASSFILE_MAJOR=65 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
3838
DEFAULT_VERSION_CLASSFILE_MINOR=0
3939
DEFAULT_VERSION_DOCS_API_SINCE=11
40-
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="19 20"
41-
DEFAULT_JDK_SOURCE_TARGET_VERSION=20
40+
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="19 20 21"
41+
DEFAULT_JDK_SOURCE_TARGET_VERSION=21
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
@@ -142,6 +142,8 @@
142142

143143
#define JAVA_20_VERSION 64
144144

145+
#define JAVA_21_VERSION 65
146+
145147
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
146148
assert((bad_constant == JVM_CONSTANT_Module ||
147149
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,17 @@ public enum ClassFileFormatVersion {
262262
* href="https://docs.oracle.com/javase/specs/jvms/se20/html/index.html">
263263
* <cite>The Java Virtual Machine Specification, Java SE 20 Edition</cite></a>
264264
*/
265-
RELEASE_20(64);
265+
RELEASE_20(64),
266+
267+
/**
268+
* The version recognized by the Java Platform, Standard Edition
269+
* 21.
270+
*
271+
* @see <a
272+
* href="https://docs.oracle.com/javase/specs/jvms/se21/html/index.html">
273+
* <cite>The Java Virtual Machine Specification, Java SE 21 Edition</cite></a>
274+
*/
275+
RELEASE_21(65);
266276

267277
// Note to maintainers: when adding constants for newer releases,
268278
// the implementation of latest() must be updated too.
@@ -277,7 +287,7 @@ private ClassFileFormatVersion(int major) {
277287
* {@return the latest class file format version}
278288
*/
279289
public static ClassFileFormatVersion latest() {
280-
return RELEASE_20;
290+
return RELEASE_21;
281291
}
282292

283293
/**

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
@@ -226,7 +226,7 @@ public ClassReader(
226226
this.b = classFileBuffer;
227227
// Check the class' major_version. This field is after the magic and minor_version fields, which
228228
// use 4 and 2 bytes respectively.
229-
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V20) {
229+
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V21) {
230230
throw new IllegalArgumentException(
231231
"Unsupported class file major version " + readShort(classFileOffset + 6));
232232
}

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
@@ -310,6 +310,7 @@ public interface Opcodes {
310310
int V18 = 0 << 16 | 62;
311311
int V19 = 0 << 16 | 63;
312312
int V20 = 0 << 16 | 64;
313+
int V21 = 0 << 16 | 65;
313314

314315
/**
315316
* Version flag indicating that the class is using 'preview' features.

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public enum SourceVersion {
7171
* record patterns in preview)
7272
* 20: no changes (pattern matching for switch in fourth preview,
7373
* record patterns in second preview)
74+
* 21: tbd
7475
*/
7576

7677
/**
@@ -372,7 +373,19 @@ public enum SourceVersion {
372373
* href="https://docs.oracle.com/javase/specs/jls/se20/html/index.html">
373374
* <cite>The Java Language Specification, Java SE 20 Edition</cite></a>
374375
*/
375-
RELEASE_20;
376+
RELEASE_20,
377+
378+
/**
379+
* The version recognized by the Java Platform, Standard Edition
380+
* 21.
381+
*
382+
* @since 21
383+
*
384+
* @see <a
385+
* href="https://docs.oracle.com/javase/specs/jls/se21/html/index.html">
386+
* <cite>The Java Language Specification, Java SE 21 Edition</cite></a>
387+
*/
388+
RELEASE_21;
376389

377390
// Note that when adding constants for newer releases, the
378391
// behavior of latest() and latestSupported() must be updated too.
@@ -381,7 +394,7 @@ public enum SourceVersion {
381394
* {@return the latest source version that can be modeled}
382395
*/
383396
public static SourceVersion latest() {
384-
return RELEASE_20;
397+
return RELEASE_21;
385398
}
386399

387400
private static final SourceVersion latestSupported = getLatestSupported();
@@ -396,7 +409,7 @@ public static SourceVersion latest() {
396409
private static SourceVersion getLatestSupported() {
397410
int intVersion = Runtime.version().feature();
398411
return (intVersion >= 11) ?
399-
valueOf("RELEASE_" + Math.min(20, intVersion)):
412+
valueOf("RELEASE_" + Math.min(21, intVersion)):
400413
RELEASE_10;
401414
}
402415

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_20)
47+
@SupportedSourceVersion(RELEASE_21)
4848
public abstract class AbstractAnnotationValueVisitor14<R, P> extends AbstractAnnotationValueVisitor9<R, P> {
4949

5050
/**

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
@@ -49,7 +49,7 @@
4949
* @see AbstractElementVisitor9
5050
* @since 16
5151
*/
52-
@SupportedSourceVersion(RELEASE_20)
52+
@SupportedSourceVersion(RELEASE_21)
5353
public abstract class AbstractElementVisitor14<R, P> extends AbstractElementVisitor9<R, P> {
5454
/**
5555
* Constructor for concrete subclasses to call.

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_20)
50+
@SupportedSourceVersion(RELEASE_21)
5151
public abstract class AbstractTypeVisitor14<R, P> extends AbstractTypeVisitor9<R, P> {
5252
/**
5353
* Constructor for concrete subclasses to call.

0 commit comments

Comments
 (0)