Skip to content
Permalink
Browse files
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
  • Loading branch information
jddarcy authored and erikj79 committed Jun 9, 2022
1 parent 2671443 commit edff51e
Show file tree
Hide file tree
Showing 69 changed files with 6,448 additions and 50 deletions.
@@ -1,7 +1,7 @@
[general]
project=jdk
jbs=JDK
version=19
version=20

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
@@ -26,17 +26,17 @@
# Default version, product, and vendor information to use,
# unless overridden by configure

DEFAULT_VERSION_FEATURE=19
DEFAULT_VERSION_FEATURE=20
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=0
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2022-09-20
DEFAULT_VERSION_CLASSFILE_MAJOR=63 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_DATE=2023-03-21
DEFAULT_VERSION_CLASSFILE_MAJOR=64 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="18 19"
DEFAULT_JDK_SOURCE_TARGET_VERSION=19
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="18 19 20"
DEFAULT_JDK_SOURCE_TARGET_VERSION=20
DEFAULT_PROMOTED_VERSION_PRE=ea
@@ -38,7 +38,7 @@
# directory.
# - open a terminal program and run these commands:
# cd "${JDK_CHECKOUT}"/src/jdk.compiler/share/data/symbols
# bash ../../scripts/generate-symbol-data.sh "${JDK_N_INSTALL}"
# bash ../../../../../make/scripts/generate-symbol-data.sh "${JDK_N_INSTALL}"
# - this command will generate or update data for "--release N" into the ${JDK_CHECKOUT}/src/jdk.compiler/share/data/symbols
# directory, updating all registration necessary. If the goal was to update the data, and there are no
# 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 \
--add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
--add-modules jdk.jdeps \
../../../make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java \
../../../../../make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java \
build-description-incremental symbols include.list
@@ -141,6 +141,8 @@

#define JAVA_19_VERSION 63

#define JAVA_20_VERSION 64

void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
assert((bad_constant == JVM_CONSTANT_Module ||
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,
@@ -226,7 +226,7 @@ public ClassReader(
this.b = classFileBuffer;
// Check the class' major_version. This field is after the magic and minor_version fields, which
// use 4 and 2 bytes respectively.
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V19) {
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V20) {
throw new IllegalArgumentException(
"Unsupported class file major version " + readShort(classFileOffset + 6));
}
@@ -309,6 +309,7 @@ public interface Opcodes {
int V17 = 0 << 16 | 61;
int V18 = 0 << 16 | 62;
int V19 = 0 << 16 | 63;
int V20 = 0 << 16 | 64;

/**
* Version flag indicating that the class is using 'preview' features.
@@ -351,7 +351,15 @@ public enum SourceVersion {
*
* @since 19
*/
RELEASE_19;
RELEASE_19,

/**
* The version recognized by the Java Platform, Standard Edition
* 20.
*
* @since 20
*/
RELEASE_20;

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

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

@@ -44,7 +44,7 @@
* @see AbstractAnnotationValueVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_19)
@SupportedSourceVersion(RELEASE_20)
public abstract class AbstractAnnotationValueVisitor14<R, P> extends AbstractAnnotationValueVisitor9<R, P> {

/**
@@ -49,7 +49,7 @@
* @see AbstractElementVisitor9
* @since 16
*/
@SupportedSourceVersion(RELEASE_19)
@SupportedSourceVersion(RELEASE_20)
public abstract class AbstractElementVisitor14<R, P> extends AbstractElementVisitor9<R, P> {
/**
* Constructor for concrete subclasses to call.
@@ -47,7 +47,7 @@
* @see AbstractTypeVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_19)
@SupportedSourceVersion(RELEASE_20)
public abstract class AbstractTypeVisitor14<R, P> extends AbstractTypeVisitor9<R, P> {
/**
* Constructor for concrete subclasses to call.
@@ -61,7 +61,7 @@
* @see ElementKindVisitor9
* @since 16
*/
@SupportedSourceVersion(RELEASE_19)
@SupportedSourceVersion(RELEASE_20)
public class ElementKindVisitor14<R, P> extends ElementKindVisitor9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
@@ -77,7 +77,7 @@
* @see ElementScanner9
* @since 16
*/
@SupportedSourceVersion(RELEASE_19)
@SupportedSourceVersion(RELEASE_20)
public class ElementScanner14<R, P> extends ElementScanner9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
@@ -52,7 +52,7 @@
* @see SimpleAnnotationValueVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_19)
@SupportedSourceVersion(RELEASE_20)
public class SimpleAnnotationValueVisitor14<R, P> extends SimpleAnnotationValueVisitor9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
@@ -57,7 +57,7 @@
* @see SimpleElementVisitor9
* @since 16
*/
@SupportedSourceVersion(RELEASE_19)
@SupportedSourceVersion(RELEASE_20)
public class SimpleElementVisitor14<R, P> extends SimpleElementVisitor9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
@@ -56,7 +56,7 @@
* @see SimpleTypeVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_19)
@SupportedSourceVersion(RELEASE_20)
public class SimpleTypeVisitor14<R, P> extends SimpleTypeVisitor9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
@@ -61,7 +61,7 @@
* @see TypeKindVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_19)
@SupportedSourceVersion(RELEASE_20)
public class TypeKindVisitor14<R, P> extends TypeKindVisitor9<R, P> {
/**
* Constructor for concrete subclasses to call; uses {@code null}
@@ -122,7 +122,12 @@ public enum Source {
/**
* 19, tbd
*/
JDK19("19");
JDK19("19"),

/**
* 20, tbd
*/
JDK20("20");

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

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

public Target requiredTarget() {
return switch(this) {
case JDK20 -> Target.JDK1_20;
case JDK19 -> Target.JDK1_19;
case JDK18 -> Target.JDK1_18;
case JDK17 -> Target.JDK1_17;
@@ -322,6 +328,7 @@ public static SourceVersion toSourceVersion(Source source) {
case JDK17 -> RELEASE_17;
case JDK18 -> RELEASE_18;
case JDK19 -> RELEASE_19;
case JDK20 -> RELEASE_20;
default -> null;
};
}
@@ -120,7 +120,8 @@ public enum Version {
V60(60, 0), // JDK 16
V61(61, 0), // JDK 17
V62(62, 0), // JDK 18
V63(63, 0); // JDK 19
V63(63, 0), // JDK 19
V64(64, 0); // JDK 20
Version(int major, int minor) {
this.major = major;
this.minor = minor;
@@ -91,7 +91,10 @@ public enum Target {
JDK1_18("18", 62, 0),

/** JDK 19. */
JDK1_19("19", 63, 0);
JDK1_19("19", 63, 0),

/** JDK 20. */
JDK1_20("20", 64, 0);

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

@@ -55,7 +55,7 @@
* deletion without notice.</b>
*/
@SupportedAnnotationTypes("*")
@SupportedSourceVersion(SourceVersion.RELEASE_19)
@SupportedSourceVersion(SourceVersion.RELEASE_20)
public class PrintingProcessor extends AbstractProcessor {
PrintWriter writer;

1 comment on commit edff51e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.