Skip to content

Commit 5a706fb

Browse files
jddarcyJesperIRL
authored andcommitted
8306584: Start of release updates for JDK 22
8306585: Add SourceVersion.RELEASE_22 8306586: Add source 22 and target 22 to javac Reviewed-by: erikj, iris, dholmes, jlahoda, alanb
1 parent bb377b2 commit 5a706fb

File tree

69 files changed

+5954
-52
lines changed

Some content is hidden

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

69 files changed

+5954
-52
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=21
4+
version=22
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=21
29+
DEFAULT_VERSION_FEATURE=22
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-09-19
37-
DEFAULT_VERSION_CLASSFILE_MAJOR=65 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
36+
DEFAULT_VERSION_DATE=2024-03-19
37+
DEFAULT_VERSION_CLASSFILE_MAJOR=66 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
3838
DEFAULT_VERSION_CLASSFILE_MINOR=0
3939
DEFAULT_VERSION_DOCS_API_SINCE=11
40-
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="20 21"
41-
DEFAULT_JDK_SOURCE_TARGET_VERSION=21
40+
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="20 21 22"
41+
DEFAULT_JDK_SOURCE_TARGET_VERSION=22
4242
DEFAULT_PROMOTED_VERSION_PRE=ea

make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3700,8 +3700,8 @@ public boolean read(LineBasedReader reader) throws IOException {
37003700
Function<String, MethodParam> string2Param =
37013701
p -> {
37023702
int sep = p.indexOf(':');
3703-
return new MethodParam(Integer.parseInt(p.substring(0, sep)),
3704-
p.substring(sep + 1));
3703+
return new MethodParam(Integer.parseInt(p.substring(0, sep), 16),
3704+
p.substring(sep + 1));
37053705
};
37063706
methodParameters =
37073707
deserializeList(inMethodParameters).stream()

src/hotspot/share/classfile/classFileParser.cpp

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

146146
#define JAVA_21_VERSION 65
147147

148+
#define JAVA_22_VERSION 66
149+
148150
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
149151
assert((bad_constant == JVM_CONSTANT_Module ||
150152
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,20 @@ public enum ClassFileFormatVersion {
281281
* href="https://docs.oracle.com/javase/specs/jvms/se21/html/index.html">
282282
* <cite>The Java Virtual Machine Specification, Java SE 21 Edition</cite></a>
283283
*/
284-
RELEASE_21(65);
284+
RELEASE_21(65),
285+
286+
/**
287+
* The version introduced by the Java Platform, Standard Edition
288+
* 22.
289+
*
290+
* @since 22
291+
*
292+
* @see <a
293+
* href="https://docs.oracle.com/javase/specs/jvms/se22/html/index.html">
294+
* <cite>The Java Virtual Machine Specification, Java SE 22 Edition</cite></a>
295+
*/
296+
RELEASE_22(66),
297+
; // Reduce code churn when appending new constants
285298

286299
// Note to maintainers: when adding constants for newer releases,
287300
// the implementation of latest() must be updated too.
@@ -296,7 +309,7 @@ private ClassFileFormatVersion(int major) {
296309
* {@return the latest class file format version}
297310
*/
298311
public static ClassFileFormatVersion latest() {
299-
return RELEASE_21;
312+
return RELEASE_22;
300313
}
301314

302315
/**

src/java.base/share/classes/jdk/internal/classfile/Classfile.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2023, 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
@@ -606,8 +606,9 @@ public static void buildModuleTo(Path path,
606606
public static final int JAVA_19_VERSION = 63;
607607
public static final int JAVA_20_VERSION = 64;
608608
public static final int JAVA_21_VERSION = 65;
609+
public static final int JAVA_22_VERSION = 66;
609610

610-
public static final int LATEST_MAJOR_VERSION = JAVA_21_VERSION;
611+
public static final int LATEST_MAJOR_VERSION = JAVA_22_VERSION;
611612
public static final int LATEST_MINOR_VERSION = 0;
612613
public static final int PREVIEW_MINOR_VERSION = -1;
613614

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.V21) {
229+
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V22) {
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
@@ -311,6 +311,7 @@ public interface Opcodes {
311311
int V19 = 0 << 16 | 63;
312312
int V20 = 0 << 16 | 64;
313313
int V21 = 0 << 16 | 65;
314+
int V22 = 0 << 16 | 66;
314315

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

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public enum SourceVersion {
7474
* 21: pattern matching for switch and record patterns (string
7575
* templates in preview, unnamed patterns and variables in
7676
* preview, unnamed classes and instance main methods in preview)
77+
* 22: tbd
7778
*/
7879

7980
/**
@@ -395,7 +396,20 @@ public enum SourceVersion {
395396
* @see <a href="https://openjdk.org/jeps/441">
396397
* Pattern Matching for switch</a>
397398
*/
398-
RELEASE_21;
399+
RELEASE_21,
400+
401+
/**
402+
* The version introduced by the Java Platform, Standard Edition
403+
* 22.
404+
*
405+
* @since 22
406+
*
407+
* @see <a
408+
* href="https://docs.oracle.com/javase/specs/jls/se22/html/index.html">
409+
* <cite>The Java Language Specification, Java SE 22 Edition</cite></a>
410+
*/
411+
RELEASE_22,
412+
; // Reduce code churn when appending new constants
399413

400414
// Note that when adding constants for newer releases, the
401415
// behavior of latest() and latestSupported() must be updated too.
@@ -404,7 +418,7 @@ public enum SourceVersion {
404418
* {@return the latest source version that can be modeled}
405419
*/
406420
public static SourceVersion latest() {
407-
return RELEASE_21;
421+
return RELEASE_22;
408422
}
409423

410424
private static final SourceVersion latestSupported = getLatestSupported();
@@ -419,7 +433,7 @@ public static SourceVersion latest() {
419433
private static SourceVersion getLatestSupported() {
420434
int intVersion = Runtime.version().feature();
421435
return (intVersion >= 11) ?
422-
valueOf("RELEASE_" + Math.min(21, intVersion)):
436+
valueOf("RELEASE_" + Math.min(22, intVersion)):
423437
RELEASE_10;
424438
}
425439

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

5050
/**

0 commit comments

Comments
 (0)