Skip to content

Commit

Permalink
8319413: Start of release updates for JDK 23
Browse files Browse the repository at this point in the history
8319414: Add SourceVersion.RELEASE_23
8319416: Add source 23 and target 23 to javac

Reviewed-by: iris, erikj, alanb, vromero
  • Loading branch information
jddarcy authored and JesperIRL committed Dec 7, 2023
1 parent 86f9b3f commit 519ecd3
Show file tree
Hide file tree
Showing 98 changed files with 4,872 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk
jbs=JDK
version=22
version=23

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
Expand Down
10 changes: 5 additions & 5 deletions make/conf/version-numbers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
# Default version, product, and vendor information to use,
# unless overridden by configure

DEFAULT_VERSION_FEATURE=22
DEFAULT_VERSION_FEATURE=23
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=2024-03-19
DEFAULT_VERSION_CLASSFILE_MAJOR=66 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_DATE=2024-09-17
DEFAULT_VERSION_CLASSFILE_MAJOR=67 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="21 22"
DEFAULT_JDK_SOURCE_TARGET_VERSION=22
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="21 22 23"
DEFAULT_JDK_SOURCE_TARGET_VERSION=23
DEFAULT_PROMOTED_VERSION_PRE=ea
2 changes: 2 additions & 0 deletions src/hotspot/share/classfile/classFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@

#define JAVA_22_VERSION 66

#define JAVA_23_VERSION 67

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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,9 @@ default List<VerifyError> verify(Path path) throws IOException {
/** The class major version of JAVA_22. */
int JAVA_22_VERSION = 66;

/** 67 */
int JAVA_23_VERSION = 67;

/**
* A minor version number indicating a class uses preview features
* of a Java SE version since 12, for major versions {@value
Expand All @@ -1486,7 +1489,7 @@ default List<VerifyError> verify(Path path) throws IOException {
* {@return the latest major Java version}
*/
static int latestMajorVersion() {
return JAVA_22_VERSION;
return JAVA_23_VERSION;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,18 @@ public enum ClassFileFormatVersion {
* <cite>The Java Virtual Machine Specification, Java SE 22 Edition</cite></a>
*/
RELEASE_22(66),

/**
* The version introduced by the Java Platform, Standard Edition
* 23.
*
* @since 23
*
* @see <a
* href="https://docs.oracle.com/javase/specs/jvms/se23/html/index.html">
* <cite>The Java Virtual Machine Specification, Java SE 23 Edition</cite></a>
*/
RELEASE_23(67),
; // Reduce code churn when appending new constants

// Note to maintainers: when adding constants for newer releases,
Expand All @@ -309,7 +321,7 @@ private ClassFileFormatVersion(int major) {
* {@return the latest class file format version}
*/
public static ClassFileFormatVersion latest() {
return RELEASE_22;
return RELEASE_23;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.V22) {
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V23) {
throw new IllegalArgumentException(
"Unsupported class file major version " + readShort(classFileOffset + 6));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ public interface Opcodes {
int V20 = 0 << 16 | 64;
int V21 = 0 << 16 | 65;
int V22 = 0 << 16 | 66;
int V23 = 0 << 16 | 67;

/**
* Version flag indicating that the class is using 'preview' features.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,18 @@ public enum SourceVersion {
* JEP 456: Unnamed Variables &amp; Patterns</a>
*/
RELEASE_22,

/**
* The version introduced by the Java Platform, Standard Edition
* 23.
*
* @since 23
*
* @see <a
* href="https://docs.oracle.com/javase/specs/jls/se23/html/index.html">
* <cite>The Java Language Specification, Java SE 23 Edition</cite></a>
*/
RELEASE_23,
; // Reduce code churn when appending new constants

// Note that when adding constants for newer releases, the
Expand All @@ -424,7 +436,7 @@ public enum SourceVersion {
* {@return the latest source version that can be modeled}
*/
public static SourceVersion latest() {
return RELEASE_22;
return RELEASE_23;
}

private static final SourceVersion latestSupported = getLatestSupported();
Expand All @@ -439,7 +451,7 @@ public static SourceVersion latest() {
private static SourceVersion getLatestSupported() {
int intVersion = Runtime.version().feature();
return (intVersion >= 11) ?
valueOf("RELEASE_" + Math.min(22, intVersion)):
valueOf("RELEASE_" + Math.min(23, intVersion)):
RELEASE_10;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -44,7 +44,7 @@
* @see AbstractAnnotationValueVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_22)
@SupportedSourceVersion(RELEASE_23)
public abstract class AbstractAnnotationValueVisitor14<R, P> extends AbstractAnnotationValueVisitor9<R, P> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @see AbstractElementVisitor9
* @since 16
*/
@SupportedSourceVersion(RELEASE_22)
@SupportedSourceVersion(RELEASE_23)
public abstract class AbstractElementVisitor14<R, P> extends AbstractElementVisitor9<R, P> {
/**
* Constructor for concrete subclasses to call.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -47,7 +47,7 @@
* @see AbstractTypeVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_22)
@SupportedSourceVersion(RELEASE_23)
public abstract class AbstractTypeVisitor14<R, P> extends AbstractTypeVisitor9<R, P> {
/**
* Constructor for concrete subclasses to call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
* @see ElementKindVisitor9
* @since 16
*/
@SupportedSourceVersion(RELEASE_22)
@SupportedSourceVersion(RELEASE_23)
public class ElementKindVisitor14<R, P> extends ElementKindVisitor9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
* @see ElementScanner9
* @since 16
*/
@SupportedSourceVersion(RELEASE_22)
@SupportedSourceVersion(RELEASE_23)
public class ElementScanner14<R, P> extends ElementScanner9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -52,7 +52,7 @@
* @see SimpleAnnotationValueVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_22)
@SupportedSourceVersion(RELEASE_23)
public class SimpleAnnotationValueVisitor14<R, P> extends SimpleAnnotationValueVisitor9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
* @see SimpleElementVisitor9
* @since 16
*/
@SupportedSourceVersion(RELEASE_22)
@SupportedSourceVersion(RELEASE_23)
public class SimpleElementVisitor14<R, P> extends SimpleElementVisitor9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -56,7 +56,7 @@
* @see SimpleTypeVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_22)
@SupportedSourceVersion(RELEASE_23)
public class SimpleTypeVisitor14<R, P> extends SimpleTypeVisitor9<R, P> {
/**
* Constructor for concrete subclasses; uses {@code null} for the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -61,7 +61,7 @@
* @see TypeKindVisitor9
* @since 14
*/
@SupportedSourceVersion(RELEASE_22)
@SupportedSourceVersion(RELEASE_23)
public class TypeKindVisitor14<R, P> extends TypeKindVisitor9<R, P> {
/**
* Constructor for concrete subclasses to call; uses {@code null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ public enum Source {
* 22, tbd
*/
JDK22("22"),

/**
* 23, tbd
*/
JDK23("23"),
; // Reduce code churn when appending new constants

private static final Context.Key<Source> sourceKey = new Context.Key<>();
Expand Down Expand Up @@ -190,6 +195,7 @@ public boolean isSupported() {

public Target requiredTarget() {
return switch(this) {
case JDK23 -> Target.JDK1_23;
case JDK22 -> Target.JDK1_22;
case JDK21 -> Target.JDK1_21;
case JDK20 -> Target.JDK1_20;
Expand Down Expand Up @@ -333,6 +339,7 @@ public static SourceVersion toSourceVersion(Source source) {
case JDK20 -> RELEASE_20;
case JDK21 -> RELEASE_21;
case JDK22 -> RELEASE_22;
case JDK23 -> RELEASE_23;
default -> null;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public enum Version {
V64(64, 0), // JDK 20
V65(65, 0), // JDK 21
V66(66, 0), // JDK 22
V67(67, 0), // JDK 23
; // Reduce code churn when appending new constants
Version(int major, int minor) {
this.major = major;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public enum Target {

/** JDK 22. */
JDK1_22("22", 66, 0),

/** JDK 23. */
JDK1_23("23", 67, 0),
; // Reduce code churn when appending new constants

private static final Context.Key<Target> targetKey = new Context.Key<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* deletion without notice.</b>
*/
@SupportedAnnotationTypes("*")
@SupportedSourceVersion(SourceVersion.RELEASE_22)
@SupportedSourceVersion(SourceVersion.RELEASE_23)
public class PrintingProcessor extends AbstractProcessor {
PrintWriter writer;

Expand Down
Loading

3 comments on commit 519ecd3

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@JesperIRL
Copy link
Member

Choose a reason for hiding this comment

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

/tag jdk-23+1

@openjdk
Copy link

@openjdk openjdk bot commented on 519ecd3 Dec 7, 2023

Choose a reason for hiding this comment

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

@JesperIRL The tag jdk-23+1 was successfully created.

Please sign in to comment.