Skip to content

Commit edff51e

Browse files
jddarcyerikj79
authored andcommitted
8284858: Start of release updates for JDK 20
8286035: Add source 20 and target 20 to javac 8286034: Add SourceVersion.RELEASE_20 Reviewed-by: dholmes, kcr, iris, erikj, jjg, ihse
1 parent 2671443 commit edff51e

File tree

69 files changed

+6448
-50
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

+6448
-50
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=19
4+
version=20
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=19
29+
DEFAULT_VERSION_FEATURE=20
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=2022-09-20
37-
DEFAULT_VERSION_CLASSFILE_MAJOR=63 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
36+
DEFAULT_VERSION_DATE=2023-03-21
37+
DEFAULT_VERSION_CLASSFILE_MAJOR=64 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
3838
DEFAULT_VERSION_CLASSFILE_MINOR=0
3939
DEFAULT_VERSION_DOCS_API_SINCE=11
40-
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="18 19"
41-
DEFAULT_JDK_SOURCE_TARGET_VERSION=19
40+
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="18 19 20"
41+
DEFAULT_JDK_SOURCE_TARGET_VERSION=20
4242
DEFAULT_PROMOTED_VERSION_PRE=ea

make/scripts/generate-symbol-data.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# directory.
3939
# - open a terminal program and run these commands:
4040
# cd "${JDK_CHECKOUT}"/src/jdk.compiler/share/data/symbols
41-
# bash ../../scripts/generate-symbol-data.sh "${JDK_N_INSTALL}"
41+
# bash ../../../../../make/scripts/generate-symbol-data.sh "${JDK_N_INSTALL}"
4242
# - this command will generate or update data for "--release N" into the ${JDK_CHECKOUT}/src/jdk.compiler/share/data/symbols
4343
# directory, updating all registration necessary. If the goal was to update the data, and there are no
4444
# new or changed files in the ${JDK_CHECKOUT}/src/jdk.compiler/share/data/symbols directory after running this script,
@@ -73,5 +73,5 @@ $1/bin/java --add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED \
7373
--add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
7474
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
7575
--add-modules jdk.jdeps \
76-
../../../make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java \
76+
../../../../../make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java \
7777
build-description-incremental symbols include.list

src/hotspot/share/classfile/classFileParser.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@
141141

142142
#define JAVA_19_VERSION 63
143143

144+
#define JAVA_20_VERSION 64
145+
144146
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
145147
assert((bad_constant == JVM_CONSTANT_Module ||
146148
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,

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

+1-1
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.V19) {
229+
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V20) {
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

+1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ public interface Opcodes {
309309
int V17 = 0 << 16 | 61;
310310
int V18 = 0 << 16 | 62;
311311
int V19 = 0 << 16 | 63;
312+
int V20 = 0 << 16 | 64;
312313

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

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

+11-3
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,15 @@ public enum SourceVersion {
351351
*
352352
* @since 19
353353
*/
354-
RELEASE_19;
354+
RELEASE_19,
355+
356+
/**
357+
* The version recognized by the Java Platform, Standard Edition
358+
* 20.
359+
*
360+
* @since 20
361+
*/
362+
RELEASE_20;
355363

356364
// Note that when adding constants for newer releases, the
357365
// behavior of latest() and latestSupported() must be updated too.
@@ -360,7 +368,7 @@ public enum SourceVersion {
360368
* {@return the latest source version that can be modeled}
361369
*/
362370
public static SourceVersion latest() {
363-
return RELEASE_19;
371+
return RELEASE_20;
364372
}
365373

366374
private static final SourceVersion latestSupported = getLatestSupported();
@@ -375,7 +383,7 @@ public static SourceVersion latest() {
375383
private static SourceVersion getLatestSupported() {
376384
int intVersion = Runtime.version().feature();
377385
return (intVersion >= 11) ?
378-
valueOf("RELEASE_" + Math.min(19, intVersion)):
386+
valueOf("RELEASE_" + Math.min(20, intVersion)):
379387
RELEASE_10;
380388
}
381389

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

5050
/**

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* @see AbstractElementVisitor9
5050
* @since 16
5151
*/
52-
@SupportedSourceVersion(RELEASE_19)
52+
@SupportedSourceVersion(RELEASE_20)
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* @see AbstractTypeVisitor9
4848
* @since 14
4949
*/
50-
@SupportedSourceVersion(RELEASE_19)
50+
@SupportedSourceVersion(RELEASE_20)
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/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_19)
64+
@SupportedSourceVersion(RELEASE_20)
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/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_19)
80+
@SupportedSourceVersion(RELEASE_20)
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/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_19)
55+
@SupportedSourceVersion(RELEASE_20)
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/SimpleElementVisitor14.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* @see SimpleElementVisitor9
5858
* @since 16
5959
*/
60-
@SupportedSourceVersion(RELEASE_19)
60+
@SupportedSourceVersion(RELEASE_20)
6161
public class SimpleElementVisitor14<R, P> extends SimpleElementVisitor9<R, P> {
6262
/**
6363
* Constructor for concrete subclasses; uses {@code null} for the

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_19)
59+
@SupportedSourceVersion(RELEASE_20)
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/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_19)
64+
@SupportedSourceVersion(RELEASE_20)
6565
public class TypeKindVisitor14<R, P> extends TypeKindVisitor9<R, P> {
6666
/**
6767
* Constructor for concrete subclasses to call; uses {@code null}

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ public enum Source {
122122
/**
123123
* 19, tbd
124124
*/
125-
JDK19("19");
125+
JDK19("19"),
126+
127+
/**
128+
* 20, tbd
129+
*/
130+
JDK20("20");
126131

127132
private static final Context.Key<Source> sourceKey = new Context.Key<>();
128133

@@ -174,6 +179,7 @@ public boolean isSupported() {
174179

175180
public Target requiredTarget() {
176181
return switch(this) {
182+
case JDK20 -> Target.JDK1_20;
177183
case JDK19 -> Target.JDK1_19;
178184
case JDK18 -> Target.JDK1_18;
179185
case JDK17 -> Target.JDK1_17;
@@ -322,6 +328,7 @@ public static SourceVersion toSourceVersion(Source source) {
322328
case JDK17 -> RELEASE_17;
323329
case JDK18 -> RELEASE_18;
324330
case JDK19 -> RELEASE_19;
331+
case JDK20 -> RELEASE_20;
325332
default -> null;
326333
};
327334
}

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ public enum Version {
120120
V60(60, 0), // JDK 16
121121
V61(61, 0), // JDK 17
122122
V62(62, 0), // JDK 18
123-
V63(63, 0); // JDK 19
123+
V63(63, 0), // JDK 19
124+
V64(64, 0); // JDK 20
124125
Version(int major, int minor) {
125126
this.major = major;
126127
this.minor = minor;

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ public enum Target {
9191
JDK1_18("18", 62, 0),
9292

9393
/** JDK 19. */
94-
JDK1_19("19", 63, 0);
94+
JDK1_19("19", 63, 0),
95+
96+
/** JDK 20. */
97+
JDK1_20("20", 64, 0);
9598

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

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_19)
58+
@SupportedSourceVersion(SourceVersion.RELEASE_20)
5959
public class PrintingProcessor extends AbstractProcessor {
6060
PrintWriter writer;
6161

0 commit comments

Comments
 (0)