8205626: Start of release updates for JDK 13
8205393: Add SourceVersion.RELEASE_13 8205394: Add source 13 and target 13 to javac 8205645: Bump maximum recognized class file version to 57 for JDK 13 8214825: Update preview language features for start of JDK 13 Reviewed-by: erikj, alanb, mchung, mcimadamore, dholmes, smarks, jjg
This commit is contained in:
parent
f32dc1764c
commit
b5f0eec3d8
@ -25,17 +25,17 @@
|
||||
|
||||
# Default version numbers to use unless overridden by configure
|
||||
|
||||
DEFAULT_VERSION_FEATURE=12
|
||||
DEFAULT_VERSION_FEATURE=13
|
||||
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=2019-03-19
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=56 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_DATE=2019-09-17
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=57 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="11 12"
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="11 12 13"
|
||||
|
||||
LAUNCHER_NAME=openjdk
|
||||
PRODUCT_NAME=OpenJDK
|
||||
|
@ -72,7 +72,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
|
||||
JVM := $(JAVA_JAVAC), \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
FLAGS := -source 12 -target 12 --doclint-format html5 \
|
||||
FLAGS := -source 13 -target 13 --doclint-format html5 \
|
||||
-encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
@ -82,7 +82,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \
|
||||
JVM := $(JAVA_JAVAC), \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
FLAGS := -source 12 -target 12 \
|
||||
FLAGS := -source 13 -target 13 \
|
||||
-encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
|
@ -119,6 +119,8 @@
|
||||
|
||||
#define JAVA_12_VERSION 56
|
||||
|
||||
#define JAVA_13_VERSION 57
|
||||
|
||||
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
|
||||
assert((bad_constant == 19 || bad_constant == 20) && _major_version >= JAVA_9_VERSION,
|
||||
"Unexpected bad constant pool entry");
|
||||
|
@ -50,6 +50,7 @@ class Constants {
|
||||
1.10 to 1.10.X 54,0
|
||||
1.11 to 1.11.X 55,0
|
||||
1.12 to 1.12.X 56,0
|
||||
1.13 to 1.13.X 57,0
|
||||
*/
|
||||
|
||||
public static final Package.Version JAVA_MIN_CLASS_VERSION =
|
||||
@ -79,6 +80,9 @@ class Constants {
|
||||
public static final Package.Version JAVA12_MAX_CLASS_VERSION =
|
||||
Package.Version.of(56, 00);
|
||||
|
||||
public static final Package.Version JAVA13_MAX_CLASS_VERSION =
|
||||
Package.Version.of(57, 00);
|
||||
|
||||
public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
|
||||
|
||||
public static final Package.Version JAVA5_PACKAGE_VERSION =
|
||||
@ -95,7 +99,7 @@ class Constants {
|
||||
|
||||
// upper limit, should point to the latest class version
|
||||
public static final Package.Version JAVA_MAX_CLASS_VERSION =
|
||||
JAVA12_MAX_CLASS_VERSION;
|
||||
JAVA13_MAX_CLASS_VERSION;
|
||||
|
||||
// upper limit should point to the latest package version, for version info!.
|
||||
public static final Package.Version MAX_PACKAGE_VERSION =
|
||||
|
@ -63,7 +63,7 @@ import static jdk.internal.module.ClassFileConstants.*;
|
||||
public final class ModuleInfo {
|
||||
|
||||
private final int JAVA_MIN_SUPPORTED_VERSION = 53;
|
||||
private final int JAVA_MAX_SUPPORTED_VERSION = 56;
|
||||
private final int JAVA_MAX_SUPPORTED_VERSION = 57;
|
||||
|
||||
private static final JavaLangModuleAccess JLMA
|
||||
= SharedSecrets.getJavaLangModuleAccess();
|
||||
|
@ -210,7 +210,7 @@ public class ClassReader {
|
||||
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.V12) {
|
||||
if (checkClassVersion && readShort(classFileOffset + 6) > Opcodes.V13) {
|
||||
throw new IllegalArgumentException(
|
||||
"Unsupported class file major version " + readShort(classFileOffset + 6));
|
||||
}
|
||||
|
@ -95,6 +95,7 @@ public interface Opcodes {
|
||||
int V10 = 0 << 16 | 54;
|
||||
int V11 = 0 << 16 | 55;
|
||||
int V12 = 0 << 16 | 56;
|
||||
int V13 = 0 << 16 | 57;
|
||||
|
||||
/**
|
||||
* Version flag indicating that the class is using 'preview' features.
|
||||
|
@ -59,6 +59,7 @@ public enum SourceVersion {
|
||||
* 10: local-variable type inference (var)
|
||||
* 11: local-variable syntax for lambda parameters
|
||||
* 12: TBD
|
||||
* 13: TBD
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -183,7 +184,15 @@ public enum SourceVersion {
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
RELEASE_12;
|
||||
RELEASE_12,
|
||||
|
||||
/**
|
||||
* The version recognized by the Java Platform, Standard Edition
|
||||
* 13.
|
||||
*
|
||||
* @since 13
|
||||
*/
|
||||
RELEASE_13;
|
||||
|
||||
// Note that when adding constants for newer releases, the
|
||||
// behavior of latest() and latestSupported() must be updated too.
|
||||
@ -194,7 +203,7 @@ public enum SourceVersion {
|
||||
* @return the latest source version that can be modeled
|
||||
*/
|
||||
public static SourceVersion latest() {
|
||||
return RELEASE_12;
|
||||
return RELEASE_13;
|
||||
}
|
||||
|
||||
private static final SourceVersion latestSupported = getLatestSupported();
|
||||
@ -204,6 +213,8 @@ public enum SourceVersion {
|
||||
String specVersion = System.getProperty("java.specification.version");
|
||||
|
||||
switch (specVersion) {
|
||||
case "13":
|
||||
return RELEASE_13;
|
||||
case "12":
|
||||
return RELEASE_12;
|
||||
case "11":
|
||||
|
@ -32,7 +32,7 @@ import javax.annotation.processing.SupportedSourceVersion;
|
||||
/**
|
||||
* A skeletal visitor for annotation values with default behavior
|
||||
* appropriate for source versions {@link SourceVersion#RELEASE_9
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}.
|
||||
*
|
||||
* <p> <b>WARNING:</b> The {@code AnnotationValueVisitor} interface
|
||||
* implemented by this class may have methods added to it in the
|
||||
@ -59,7 +59,7 @@ import javax.annotation.processing.SupportedSourceVersion;
|
||||
* @see AbstractAnnotationValueVisitor8
|
||||
* @since 9
|
||||
*/
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public abstract class AbstractAnnotationValueVisitor9<R, P> extends AbstractAnnotationValueVisitor8<R, P> {
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
/**
|
||||
* A skeletal visitor of program elements with default behavior
|
||||
* appropriate for source versions {@link SourceVersion#RELEASE_9
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}.
|
||||
*
|
||||
* <p> <b>WARNING:</b> The {@code ElementVisitor} interface
|
||||
* implemented by this class may have methods added to it in the
|
||||
@ -65,7 +65,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
* @since 9
|
||||
* @spec JPMS
|
||||
*/
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public abstract class AbstractElementVisitor9<R, P> extends AbstractElementVisitor8<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses to call.
|
||||
|
@ -33,7 +33,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
/**
|
||||
* A skeletal visitor of types with default behavior appropriate for
|
||||
* source versions {@link SourceVersion#RELEASE_9 RELEASE_9} through
|
||||
* {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
* {@link SourceVersion#RELEASE_13 RELEASE_13}.
|
||||
*
|
||||
* <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented
|
||||
* by this class may have methods added to it in the future to
|
||||
@ -63,7 +63,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
* @see AbstractTypeVisitor8
|
||||
* @since 9
|
||||
*/
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public abstract class AbstractTypeVisitor9<R, P> extends AbstractTypeVisitor8<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses to call.
|
||||
|
@ -34,7 +34,7 @@ import javax.lang.model.SourceVersion;
|
||||
* A visitor of program elements based on their {@linkplain
|
||||
* ElementKind kind} with default behavior appropriate for source
|
||||
* versions {@link SourceVersion#RELEASE_9 RELEASE_9} through {@link
|
||||
* SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
* SourceVersion#RELEASE_13 RELEASE_13}.
|
||||
*
|
||||
* For {@linkplain
|
||||
* Element elements} <code><i>Xyz</i></code> that may have more than one
|
||||
@ -80,7 +80,7 @@ import javax.lang.model.SourceVersion;
|
||||
* @since 9
|
||||
* @spec JPMS
|
||||
*/
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public class ElementKindVisitor9<R, P> extends ElementKindVisitor8<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
|
@ -34,7 +34,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
/**
|
||||
* A scanning visitor of program elements with default behavior
|
||||
* appropriate for source versions {@link SourceVersion#RELEASE_9
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}.
|
||||
*
|
||||
* The <code>visit<i>Xyz</i></code> methods in this
|
||||
* class scan their component elements by calling {@code scan} on
|
||||
@ -92,7 +92,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
* @since 9
|
||||
* @spec JPMS
|
||||
*/
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public class ElementScanner9<R, P> extends ElementScanner8<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
|
@ -32,7 +32,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
/**
|
||||
* A simple visitor for annotation values with default behavior
|
||||
* appropriate for source versions {@link SourceVersion#RELEASE_9
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}.
|
||||
*
|
||||
* Visit methods call {@link #defaultAction
|
||||
* defaultAction} passing their arguments to {@code defaultAction}'s
|
||||
@ -68,7 +68,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
* @see SimpleAnnotationValueVisitor8
|
||||
* @since 9
|
||||
*/
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public class SimpleAnnotationValueVisitor9<R, P> extends SimpleAnnotationValueVisitor8<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
|
@ -33,7 +33,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
/**
|
||||
* A simple visitor of program elements with default behavior
|
||||
* appropriate for source versions {@link SourceVersion#RELEASE_9
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_13 RELEASE_13}.
|
||||
*
|
||||
* Visit methods corresponding to {@code RELEASE_9} and earlier
|
||||
* language constructs call {@link #defaultAction defaultAction},
|
||||
@ -73,7 +73,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
* @since 9
|
||||
* @spec JPMS
|
||||
*/
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public class SimpleElementVisitor9<R, P> extends SimpleElementVisitor8<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
|
@ -33,7 +33,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
/**
|
||||
* A simple visitor of types with default behavior appropriate for
|
||||
* source versions {@link SourceVersion#RELEASE_9 RELEASE_9} through
|
||||
* {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
* {@link SourceVersion#RELEASE_13 RELEASE_13}.
|
||||
*
|
||||
* Visit methods corresponding to {@code RELEASE_9} and earlier
|
||||
* language constructs call {@link #defaultAction defaultAction},
|
||||
@ -73,7 +73,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
* @see SimpleTypeVisitor8
|
||||
* @since 9
|
||||
*/
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public class SimpleTypeVisitor9<R, P> extends SimpleTypeVisitor8<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
|
@ -34,7 +34,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
* A visitor of types based on their {@linkplain TypeKind kind} with
|
||||
* default behavior appropriate for source versions {@link
|
||||
* SourceVersion#RELEASE_9 RELEASE_9} through {@link
|
||||
* SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
* SourceVersion#RELEASE_13 RELEASE_13}.
|
||||
*
|
||||
* For {@linkplain
|
||||
* TypeMirror types} <code><i>Xyz</i></code> that may have more than one
|
||||
@ -77,7 +77,7 @@ import static javax.lang.model.SourceVersion.*;
|
||||
* @see TypeKindVisitor8
|
||||
* @since 9
|
||||
*/
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public class TypeKindVisitor9<R, P> extends TypeKindVisitor8<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses to call; uses {@code null}
|
||||
|
@ -85,7 +85,10 @@ public enum Source {
|
||||
JDK11("11"),
|
||||
|
||||
/** 12 covers the to be determined language features that will be added in JDK 12. */
|
||||
JDK12("12");
|
||||
JDK12("12"),
|
||||
|
||||
/** 13 covers the to be determined language features that will be added in JDK 13. */
|
||||
JDK13("13");
|
||||
|
||||
private static final Context.Key<Source> sourceKey = new Context.Key<>();
|
||||
|
||||
@ -136,6 +139,7 @@ public enum Source {
|
||||
}
|
||||
|
||||
public Target requiredTarget() {
|
||||
if (this.compareTo(JDK13) >= 0) return Target.JDK1_13;
|
||||
if (this.compareTo(JDK12) >= 0) return Target.JDK1_12;
|
||||
if (this.compareTo(JDK11) >= 0) return Target.JDK1_11;
|
||||
if (this.compareTo(JDK10) >= 0) return Target.JDK1_10;
|
||||
@ -182,10 +186,10 @@ public enum Source {
|
||||
LOCAL_VARIABLE_TYPE_INFERENCE(JDK10),
|
||||
VAR_SYNTAX_IMPLICIT_LAMBDAS(JDK11, Fragments.FeatureVarSyntaxInImplicitLambda, DiagKind.PLURAL),
|
||||
IMPORT_ON_DEMAND_OBSERVABLE_PACKAGES(JDK1_2, JDK8),
|
||||
SWITCH_MULTIPLE_CASE_LABELS(JDK12, Fragments.FeatureMultipleCaseLabels, DiagKind.PLURAL),
|
||||
SWITCH_RULE(JDK12, Fragments.FeatureSwitchRules, DiagKind.PLURAL),
|
||||
SWITCH_EXPRESSION(JDK12, Fragments.FeatureSwitchExpressions, DiagKind.PLURAL),
|
||||
RAW_STRING_LITERALS(JDK12, Fragments.FeatureRawStringLiterals, DiagKind.PLURAL);
|
||||
SWITCH_MULTIPLE_CASE_LABELS(JDK13, Fragments.FeatureMultipleCaseLabels, DiagKind.PLURAL),
|
||||
SWITCH_RULE(JDK13, Fragments.FeatureSwitchRules, DiagKind.PLURAL),
|
||||
SWITCH_EXPRESSION(JDK13, Fragments.FeatureSwitchExpressions, DiagKind.PLURAL),
|
||||
RAW_STRING_LITERALS(JDK13, Fragments.FeatureRawStringLiterals, DiagKind.PLURAL);
|
||||
|
||||
enum DiagKind {
|
||||
NORMAL,
|
||||
@ -270,6 +274,8 @@ public enum Source {
|
||||
return RELEASE_11;
|
||||
case JDK12:
|
||||
return RELEASE_12;
|
||||
case JDK13:
|
||||
return RELEASE_13;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -116,7 +116,8 @@ public class ClassFile {
|
||||
V53(53, 0), // JDK 1.9: modules, indy string concat
|
||||
V54(54, 0), // JDK 10
|
||||
V55(55, 0), // JDK 11: constant dynamic, nest mates
|
||||
V56(56, 0); // JDK 12
|
||||
V56(56, 0), // JDK 12
|
||||
V57(57, 0); // JDK 13
|
||||
Version(int major, int minor) {
|
||||
this.major = major;
|
||||
this.minor = minor;
|
||||
|
@ -40,9 +40,9 @@ import static com.sun.tools.javac.main.Option.PROFILE;
|
||||
* deletion without notice.</b>
|
||||
*/
|
||||
public enum Profile {
|
||||
COMPACT1("compact1", 1, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12),
|
||||
COMPACT2("compact2", 2, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12),
|
||||
COMPACT3("compact3", 3, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12),
|
||||
COMPACT1("compact1", 1, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12, Target.JDK1_13),
|
||||
COMPACT2("compact2", 2, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12, Target.JDK1_13),
|
||||
COMPACT3("compact3", 3, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11, Target.JDK1_12, Target.JDK1_13),
|
||||
|
||||
DEFAULT {
|
||||
@Override
|
||||
|
@ -70,7 +70,10 @@ public enum Target {
|
||||
JDK1_11("11", 55, 0),
|
||||
|
||||
/** JDK 12. */
|
||||
JDK1_12("12", 56, 0);
|
||||
JDK1_12("12", 56, 0),
|
||||
|
||||
/** JDK 13. */
|
||||
JDK1_13("13", 57, 0);
|
||||
|
||||
private static final Context.Key<Target> targetKey = new Context.Key<>();
|
||||
|
||||
|
@ -55,7 +55,7 @@ import com.sun.tools.javac.util.StringUtils;
|
||||
* deletion without notice.</b>
|
||||
*/
|
||||
@SupportedAnnotationTypes("*")
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_12)
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_13)
|
||||
public class PrintingProcessor extends AbstractProcessor {
|
||||
PrintWriter writer;
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class Classfile {
|
||||
private final List<ClassfileBytecode> codeAttributes;
|
||||
|
||||
private static final int MAJOR_VERSION_JAVA_MIN = 51; // JDK7
|
||||
private static final int MAJOR_VERSION_JAVA_MAX = 56; // JDK12
|
||||
private static final int MAJOR_VERSION_JAVA_MAX = 57; // JDK13
|
||||
private static final int MAGIC = 0xCAFEBABE;
|
||||
|
||||
/**
|
||||
|
@ -106,7 +106,7 @@ public class Main implements DiagnosticListener<JavaFileObject> {
|
||||
// Keep these updated manually until there's a compiler API
|
||||
// that allows querying of supported releases.
|
||||
final Set<String> releasesWithoutForRemoval = Set.of("6", "7", "8");
|
||||
final Set<String> releasesWithForRemoval = Set.of("9", "10", "11", "12");
|
||||
final Set<String> releasesWithForRemoval = Set.of("9", "10", "11", "12", "13");
|
||||
|
||||
final Set<String> validReleases;
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ public interface RuntimeConstants {
|
||||
/* Class File Constants */
|
||||
int JAVA_MAGIC = 0xcafebabe;
|
||||
int JAVA_MIN_SUPPORTED_VERSION = 45;
|
||||
int JAVA_MAX_SUPPORTED_VERSION = 56;
|
||||
int JAVA_MAX_SUPPORTED_VERSION = 57;
|
||||
int JAVA_MAX_SUPPORTED_MINOR_VERSION = 0;
|
||||
|
||||
/* Generate class file version for 1.1 by default */
|
||||
|
@ -23,7 +23,7 @@ modules=java.xml
|
||||
groups=TEST.groups
|
||||
|
||||
# Minimum jtreg version
|
||||
requiredVersion=4.2 b12
|
||||
requiredVersion=4.2 b13
|
||||
|
||||
# Path to libraries in the topmost test directory. This is needed so @library
|
||||
# does not need ../../ notation to reach them
|
||||
|
@ -49,7 +49,7 @@ requires.properties= \
|
||||
release.implementor
|
||||
|
||||
# Minimum jtreg version
|
||||
requiredVersion=4.2 b12
|
||||
requiredVersion=4.2 b13
|
||||
|
||||
# Path to libraries in the topmost test directory. This is needed so @library
|
||||
# does not need ../../ notation to reach them
|
||||
|
@ -56,6 +56,7 @@ public class ClassFileVersionsTest {
|
||||
{ 54, 0, Set.of() }, // JDK 10
|
||||
{ 55, 0, Set.of() }, // JDK 11
|
||||
{ 56, 0, Set.of() }, // JDK 12
|
||||
{ 57, 0, Set.of() }, // JDK 13
|
||||
};
|
||||
}
|
||||
|
||||
@ -79,7 +80,11 @@ public class ClassFileVersionsTest {
|
||||
{ 56, 0, Set.of(TRANSITIVE) },
|
||||
{ 56, 0, Set.of(STATIC, TRANSITIVE) },
|
||||
|
||||
{ 57, 0, Set.of()}, // JDK 13
|
||||
{ 57, 0, Set.of(STATIC) }, // JDK 13
|
||||
{ 57, 0, Set.of(TRANSITIVE) },
|
||||
{ 57, 0, Set.of(STATIC, TRANSITIVE) },
|
||||
|
||||
{ 58, 0, Set.of()}, // JDK 14
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ keys=intermittent randomness
|
||||
groups=TEST.groups
|
||||
|
||||
# Minimum jtreg version
|
||||
requiredVersion=4.2 b12
|
||||
requiredVersion=4.2 b13
|
||||
|
||||
# Use new module options
|
||||
useNewOptions=true
|
||||
|
@ -32,8 +32,8 @@
|
||||
* jdk.compiler/com.sun.tools.javac.main
|
||||
* jdk.compiler/com.sun.tools.javac.util
|
||||
* @clean T1 T2
|
||||
* @compile -source 11 -target 12 T1.java
|
||||
* @compile -source 11 -target 12 T2.java
|
||||
* @compile -source 12 -target 13 T1.java
|
||||
* @compile -source 12 -target 13 T2.java
|
||||
* @run main/othervm T6330997
|
||||
*/
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @summary The compiler was allowing void types in its parsing of conditional expressions.
|
||||
* @author tball
|
||||
*
|
||||
* @compile/fail/ref=ConditionalWithVoid.out --enable-preview -source 12 -XDrawDiagnostics ConditionalWithVoid.java
|
||||
* @compile/fail/ref=ConditionalWithVoid.out --enable-preview -source 13 -XDrawDiagnostics ConditionalWithVoid.java
|
||||
*/
|
||||
public class ConditionalWithVoid {
|
||||
public void test(Object o, String s) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* @test
|
||||
* @summary Unit tests for Raw String Literal language changes
|
||||
* @compile --enable-preview -source 12 -encoding utf8 RawStringLiteralLang.java
|
||||
* @compile --enable-preview -source 13 -encoding utf8 RawStringLiteralLang.java
|
||||
* @run main/othervm --enable-preview RawStringLiteralLang
|
||||
*/
|
||||
|
||||
|
@ -130,7 +130,7 @@ public class RawStringLiteralLangAPI {
|
||||
new JavacTask(TOOLBOX)
|
||||
.sources(code)
|
||||
.classpath(".")
|
||||
.options("--enable-preview", "-source", "12")
|
||||
.options("--enable-preview", "-source", "13")
|
||||
.run();
|
||||
String output = new JavaTask(TOOLBOX)
|
||||
.vmOptions("--enable-preview")
|
||||
@ -153,7 +153,7 @@ public class RawStringLiteralLangAPI {
|
||||
String output = new JavacTask(TOOLBOX)
|
||||
.sources(source)
|
||||
.classpath(".")
|
||||
.options("--enable-preview", "-source", "12", "-encoding", "utf8")
|
||||
.options("--enable-preview", "-source", "13", "-encoding", "utf8")
|
||||
.run()
|
||||
.writeAll()
|
||||
.getOutput(Task.OutputKind.DIRECT);
|
||||
@ -170,7 +170,7 @@ public class RawStringLiteralLangAPI {
|
||||
String errors = new JavacTask(TOOLBOX)
|
||||
.sources(source)
|
||||
.classpath(".")
|
||||
.options("-XDrawDiagnostics", "--enable-preview", "-source", "12", "-encoding", "utf8")
|
||||
.options("-XDrawDiagnostics", "--enable-preview", "-source", "13", "-encoding", "utf8")
|
||||
.run(Task.Expect.FAIL)
|
||||
.writeAll()
|
||||
.getOutput(Task.OutputKind.DIRECT);
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6395981 6458819 7025784 8028543 8028544 8193291 8193292 8193292
|
||||
* @bug 6395981 6458819 7025784 8028543 8028544 8193291 8193292 8193292 8205393
|
||||
* @summary JavaCompilerTool and Tool must specify version of JLS and JVMS
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @modules java.compiler
|
||||
@ -31,7 +31,7 @@
|
||||
* @run main/fail T6395981
|
||||
* @run main/fail T6395981 RELEASE_3 RELEASE_5 RELEASE_6
|
||||
* @run main/fail T6395981 RELEASE_0 RELEASE_1 RELEASE_2 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6
|
||||
* @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7 RELEASE_8 RELEASE_9 RELEASE_10 RELEASE_11 RELEASE_12
|
||||
* @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7 RELEASE_8 RELEASE_9 RELEASE_10 RELEASE_11 RELEASE_12 RELEASE_13
|
||||
*/
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
@ -47,7 +47,8 @@ public class ClassVersionChecker {
|
||||
NINE("9", 53),
|
||||
TEN("10", 54),
|
||||
ELEVEN("11", 55),
|
||||
TWELVE("12", 56);
|
||||
TWELVE("12", 56),
|
||||
THIRTEEN("13", 57);
|
||||
|
||||
private Version(String release, int classFileVer) {
|
||||
this.release = release;
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.break.ambiguous.target
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class BreakAmbiguousTarget {
|
||||
void m(int i, int j) {
|
||||
|
@ -33,7 +33,7 @@
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// key: compiler.note.note
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
// run: backdoor
|
||||
|
||||
class BreakExprNotImmediate {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.break.missing.value
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class BreakMissingValue {
|
||||
int t(int i) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.break.outside.switch.expression
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class BreakOutsideSwitchExpression {
|
||||
int t(int i) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.continue.outside.switch.expression
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class ContinueOutsideSwitchExpression {
|
||||
int t(int i) {
|
||||
|
@ -26,7 +26,7 @@
|
||||
// key: compiler.misc.inconvertible.types
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
|
||||
class IncompatibleTypesInSwitchExpression {
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
// key: compiler.misc.feature.multiple.case.labels
|
||||
// key: compiler.warn.preview.feature.use.plural
|
||||
// options: --enable-preview -source 12 -Xlint:preview
|
||||
// options: --enable-preview -source 13 -Xlint:preview
|
||||
|
||||
class MultipleCaseLabels {
|
||||
void m(int i) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.not.exhaustive
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class NotExhaustive {
|
||||
int t(int i) {
|
||||
|
@ -25,7 +25,7 @@
|
||||
//key: compiler.warn.preview.feature.use.plural
|
||||
//key: compiler.misc.feature.diamond
|
||||
//key: compiler.misc.feature.lambda
|
||||
//options: -Xlint:preview -XDforcePreview -source 12 --enable-preview
|
||||
//options: -Xlint:preview -XDforcePreview -source 13 --enable-preview
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: -XDforcePreview -source 12 --enable-preview
|
||||
// options: -XDforcePreview -source 13 --enable-preview
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.note.preview.filename.additional
|
||||
// key: compiler.warn.preview.feature.use
|
||||
// key: compiler.misc.feature.diamond
|
||||
// options: -Xlint:preview -Xmaxwarns 1 -XDforcePreview -source 12 --enable-preview
|
||||
// options: -Xlint:preview -Xmaxwarns 1 -XDforcePreview -source 13 --enable-preview
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
// key: compiler.note.preview.plural
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: -XDforcePreview -source 12 --enable-preview
|
||||
// options: -XDforcePreview -source 13 --enable-preview
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.unicode.backtick
|
||||
// key: compiler.misc.feature.raw.string.literals
|
||||
// key: compiler.warn.preview.feature.use.plural
|
||||
// options: --enable-preview -source 12 -Xlint:preview
|
||||
// options: --enable-preview -source 13 -Xlint:preview
|
||||
|
||||
class RawStringLiteral {
|
||||
String m() {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.return.outside.switch.expression
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class ReturnOutsideSwitchExpression {
|
||||
int t(int i) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.rule.completes.normally
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class RuleCompletesNormally {
|
||||
public String convert(int i) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.switch.case.unexpected.statement
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class ReturnOutsideSwitchExpression {
|
||||
void t(int i) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.switch.expression.completes.normally
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class SwitchExpressionCompletesNormally {
|
||||
public String convert(int i) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.switch.expression.empty
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class BreakOutsideSwitchExpression {
|
||||
String t(E e) {
|
||||
|
@ -26,7 +26,7 @@
|
||||
// key: compiler.misc.switch.expression.target.cant.be.void
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class SwitchExpressionTargetCantBeVoid {
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
// key: compiler.misc.feature.switch.expressions
|
||||
// key: compiler.warn.preview.feature.use.plural
|
||||
// options: --enable-preview -source 12 -Xlint:preview
|
||||
// options: --enable-preview -source 13 -Xlint:preview
|
||||
|
||||
class SwitchExpressions {
|
||||
int m(int i) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
// key: compiler.err.switch.mixing.case.types
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: --enable-preview -source 12
|
||||
// options: --enable-preview -source 13
|
||||
|
||||
class SwitchMixingCaseTypes {
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
// key: compiler.misc.feature.switch.rules
|
||||
// key: compiler.warn.preview.feature.use.plural
|
||||
// options: --enable-preview -source 12 -Xlint:preview
|
||||
// options: --enable-preview -source 13 -Xlint:preview
|
||||
|
||||
class SwitchExpressions {
|
||||
void m(int i) {
|
||||
|
@ -75,6 +75,8 @@ public class ExpSwitchNestingTest extends JavacTemplateTestBase {
|
||||
}
|
||||
}
|
||||
|
||||
private static String[] PREVIEW_OPTIONS = {"--enable-preview", "-source", "13"};
|
||||
|
||||
private void program(String... constructs) {
|
||||
String s = "class C { static boolean cond = false; static int x = 0; void m() { # } }";
|
||||
for (String c : constructs)
|
||||
@ -84,7 +86,7 @@ public class ExpSwitchNestingTest extends JavacTemplateTestBase {
|
||||
|
||||
private void assertOK(String... constructs) {
|
||||
reset();
|
||||
addCompileOptions("--enable-preview", "-source", "12");
|
||||
addCompileOptions(PREVIEW_OPTIONS);
|
||||
program(constructs);
|
||||
try {
|
||||
compile();
|
||||
@ -97,7 +99,7 @@ public class ExpSwitchNestingTest extends JavacTemplateTestBase {
|
||||
|
||||
private void assertOKWithWarning(String warning, String... constructs) {
|
||||
reset();
|
||||
addCompileOptions("--enable-preview", "-source", "12");
|
||||
addCompileOptions(PREVIEW_OPTIONS);
|
||||
program(constructs);
|
||||
try {
|
||||
compile();
|
||||
@ -110,7 +112,7 @@ public class ExpSwitchNestingTest extends JavacTemplateTestBase {
|
||||
|
||||
private void assertFail(String expectedDiag, String... constructs) {
|
||||
reset();
|
||||
addCompileOptions("--enable-preview", "-source", "12");
|
||||
addCompileOptions(PREVIEW_OPTIONS);
|
||||
program(constructs);
|
||||
try {
|
||||
compile();
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8206986
|
||||
* @summary Adding switch expressions
|
||||
* @compile/fail/ref=BadSwitchExpressionLambda.out -XDrawDiagnostics --enable-preview -source 12 BadSwitchExpressionLambda.java
|
||||
* @compile/fail/ref=BadSwitchExpressionLambda.out -XDrawDiagnostics --enable-preview -source 13 BadSwitchExpressionLambda.java
|
||||
*/
|
||||
|
||||
class BadSwitchExpressionLambda {
|
||||
|
@ -110,7 +110,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
* corresponding platform visitor type.
|
||||
*/
|
||||
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public static abstract class AbstractAnnotationValueVisitor<R, P> extends AbstractAnnotationValueVisitor9<R, P> {
|
||||
|
||||
/**
|
||||
@ -121,7 +121,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public static abstract class AbstractElementVisitor<R, P> extends AbstractElementVisitor9<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses to call.
|
||||
@ -131,7 +131,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public static abstract class AbstractTypeVisitor<R, P> extends AbstractTypeVisitor9<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses to call.
|
||||
@ -141,7 +141,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public static class ElementKindVisitor<R, P> extends ElementKindVisitor9<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
@ -162,7 +162,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public static class ElementScanner<R, P> extends ElementScanner9<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
@ -181,7 +181,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public static class SimpleAnnotationValueVisitor<R, P> extends SimpleAnnotationValueVisitor9<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
@ -202,7 +202,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public static class SimpleElementVisitor<R, P> extends SimpleElementVisitor9<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
@ -223,7 +223,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public static class SimpleTypeVisitor<R, P> extends SimpleTypeVisitor9<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses; uses {@code null} for the
|
||||
@ -244,7 +244,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
@SupportedSourceVersion(RELEASE_13)
|
||||
public static class TypeKindVisitor<R, P> extends TypeKindVisitor9<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses to call; uses {@code null}
|
||||
|
@ -1096,7 +1096,7 @@ public class JavacParserTest extends TestCase {
|
||||
String expectedErrors = "Test.java:1:178: compiler.err.switch.case.unexpected.statement\n";
|
||||
StringWriter out = new StringWriter();
|
||||
JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(out, fm, null,
|
||||
Arrays.asList("-XDrawDiagnostics", "--enable-preview", "-source", "12"),
|
||||
Arrays.asList("-XDrawDiagnostics", "--enable-preview", "-source", "13"),
|
||||
null, Arrays.asList(new MyFileObject(code)));
|
||||
|
||||
CompilationUnitTree cut = ct.parse().iterator().next();
|
||||
|
@ -2,9 +2,9 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8199194
|
||||
* @summary smoke test for --enabled-preview classreader support
|
||||
* @compile -XDforcePreview --enable-preview -source 12 Bar.java
|
||||
* @compile -XDforcePreview --enable-preview -source 13 Bar.java
|
||||
* @compile/fail/ref=Client.nopreview.out -Xlint:preview -XDrawDiagnostics Client.java
|
||||
* @compile/fail/ref=Client.preview.out -Werror -Xlint:preview -XDrawDiagnostics --enable-preview -source 12 Client.java
|
||||
* @compile/fail/ref=Client.preview.out -Werror -Xlint:preview -XDrawDiagnostics --enable-preview -source 13 Client.java
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
|
@ -1,2 +1,2 @@
|
||||
- compiler.err.preview.feature.disabled.classfile: Bar.class, 12
|
||||
- compiler.err.preview.feature.disabled.classfile: Bar.class, 13
|
||||
1 error
|
||||
|
@ -1,4 +1,4 @@
|
||||
- compiler.warn.preview.feature.use.classfile: Bar.class, 12
|
||||
- compiler.warn.preview.feature.use.classfile: Bar.class, 13
|
||||
- compiler.err.warnings.and.werror
|
||||
1 error
|
||||
1 warning
|
||||
|
@ -151,6 +151,7 @@ public class ProfileOptionTest {
|
||||
case JDK1_10:
|
||||
case JDK1_11:
|
||||
case JDK1_12:
|
||||
case JDK1_13:
|
||||
if (p == Profile.DEFAULT)
|
||||
break;
|
||||
if (ise == null)
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Verify rule cases with expression statements and throw statements work.
|
||||
* @compile --enable-preview -source 12 BlockExpression.java
|
||||
* @compile --enable-preview -source 13 BlockExpression.java
|
||||
* @run main/othervm --enable-preview BlockExpression
|
||||
*/
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8206986
|
||||
* @summary Verify the type of a conditional expression with nested switch expression is computed properly
|
||||
* @compile/fail/ref=BooleanNumericNonNumeric.out -XDrawDiagnostics --enable-preview -source 12 BooleanNumericNonNumeric.java
|
||||
* @compile/fail/ref=BooleanNumericNonNumeric.out -XDrawDiagnostics --enable-preview -source 13 BooleanNumericNonNumeric.java
|
||||
*/
|
||||
|
||||
public class BooleanNumericNonNumeric {
|
||||
|
@ -66,7 +66,7 @@ public class BreakTest {
|
||||
|
||||
StringWriter out = new StringWriter();
|
||||
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
|
||||
List.of("-XDdev", "--enable-preview", "-source", "12"), null,
|
||||
List.of("-XDdev", "--enable-preview", "-source", "13"), null,
|
||||
Arrays.asList(new MyFileObject(CODE)));
|
||||
List<String> labels = new ArrayList<>();
|
||||
new TreePathScanner<Void, Void>() {
|
||||
|
@ -151,7 +151,7 @@ public class CRT {
|
||||
new JavacTask(tb)
|
||||
.options("-Xjcov",
|
||||
"--enable-preview",
|
||||
"-source", "12")
|
||||
"-source", "13")
|
||||
.outdir(classes)
|
||||
.sources("public class Test {\n" +
|
||||
code +
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8214031
|
||||
* @summary Verify that definite assignment when true works (legal code)
|
||||
* @compile --enable-preview --source 12 DefiniteAssignment1.java
|
||||
* @compile --enable-preview --source 13 DefiniteAssignment1.java
|
||||
* @run main/othervm --enable-preview DefiniteAssignment1
|
||||
*/
|
||||
public class DefiniteAssignment1 {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8214031
|
||||
* @summary Verify that definite assignment when true works (illegal code)
|
||||
* @compile/fail/ref=DefiniteAssignment2.out --enable-preview --source 12 -XDrawDiagnostics DefiniteAssignment2.java
|
||||
* @compile/fail/ref=DefiniteAssignment2.out --enable-preview --source 13 -XDrawDiagnostics DefiniteAssignment2.java
|
||||
*/
|
||||
public class DefiniteAssignment2 {
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Verify than an empty switch expression is rejected.
|
||||
* @compile/fail/ref=EmptySwitch.out --enable-preview -source 12 -XDrawDiagnostics EmptySwitch.java
|
||||
* @compile/fail/ref=EmptySwitch.out --enable-preview -source 13 -XDrawDiagnostics EmptySwitch.java
|
||||
*/
|
||||
|
||||
public class EmptySwitch {
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Verify that an switch expression over enum can be exhaustive without default.
|
||||
* @compile --enable-preview -source 12 ExhaustiveEnumSwitch.java
|
||||
* @compile --enable-preview -source 13 ExhaustiveEnumSwitch.java
|
||||
* @compile ExhaustiveEnumSwitchExtra.java
|
||||
* @run main/othervm --enable-preview ExhaustiveEnumSwitch
|
||||
*/
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @bug 8206986
|
||||
* @summary Check expression switch works.
|
||||
* @compile/fail/ref=ExpressionSwitch-old.out -source 9 -Xlint:-options -XDrawDiagnostics ExpressionSwitch.java
|
||||
* @compile --enable-preview -source 12 ExpressionSwitch.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitch.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitch
|
||||
*/
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Verify behavior of various kinds of breaks.
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchBreaks1.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchBreaks1.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchBreaks1
|
||||
*/
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8206986
|
||||
* @summary Check behavior for invalid breaks.
|
||||
* @compile/fail/ref=ExpressionSwitchBreaks2.out -XDrawDiagnostics --enable-preview -source 12 ExpressionSwitchBreaks2.java
|
||||
* @compile/fail/ref=ExpressionSwitchBreaks2.out -XDrawDiagnostics --enable-preview -source 13 ExpressionSwitchBreaks2.java
|
||||
*/
|
||||
|
||||
public class ExpressionSwitchBreaks2 {
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986 8214114 8214529
|
||||
* @summary Verify various corner cases with nested switch expressions.
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchBugs.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchBugs.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchBugs
|
||||
*/
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8214031
|
||||
* @summary Verify various corner cases with nested switch expressions.
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchBugsInGen.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchBugsInGen.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchBugsInGen
|
||||
*/
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Check switch expressions
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchCodeFromJLS.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchCodeFromJLS.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchCodeFromJLS
|
||||
*/
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Check definite (un)assignment for in switch expressions.
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchDA.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchDA.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchDA
|
||||
*/
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8214031 8214114
|
||||
* @summary Verify switch expressions embedded in various statements work properly.
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchEmbedding.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchEmbedding.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchEmbedding
|
||||
*/
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Check fall through in switch expressions.
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchFallThrough.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchFallThrough.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchFallThrough
|
||||
*/
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Check fall through in switch expressions.
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchFallThrough1.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchFallThrough1.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchFallThrough1
|
||||
*/
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8212982
|
||||
* @summary Verify a compile-time error is produced if switch expression does not provide a value
|
||||
* @compile/fail/ref=ExpressionSwitchFlow.out --enable-preview -source 12 -XDrawDiagnostics ExpressionSwitchFlow.java
|
||||
* @compile/fail/ref=ExpressionSwitchFlow.out --enable-preview -source 13 -XDrawDiagnostics ExpressionSwitchFlow.java
|
||||
*/
|
||||
|
||||
public class ExpressionSwitchFlow {
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Check switch expressions embedded in switch expressions.
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchInExpressionSwitch.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchInExpressionSwitch.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchInExpressionSwitch
|
||||
*/
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8206986
|
||||
* @summary Check types inferred for switch expressions.
|
||||
* @compile/fail/ref=ExpressionSwitchInfer.out -XDrawDiagnostics --enable-preview -source 12 ExpressionSwitchInfer.java
|
||||
* @compile/fail/ref=ExpressionSwitchInfer.out -XDrawDiagnostics --enable-preview -source 13 ExpressionSwitchInfer.java
|
||||
*/
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8206986
|
||||
* @summary Verify behavior when an intersection type is inferred for switch expression.
|
||||
* @compile --enable-preview -source 12 ExpressionSwitchIntersectionTypes.java
|
||||
* @compile --enable-preview -source 13 ExpressionSwitchIntersectionTypes.java
|
||||
* @run main/othervm --enable-preview ExpressionSwitchIntersectionTypes
|
||||
*/
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8206986
|
||||
* @summary Verify behavior of not exhaustive switch expressions.
|
||||
* @compile/fail/ref=ExpressionSwitchNotExhaustive.out -XDrawDiagnostics --enable-preview -source 12 ExpressionSwitchNotExhaustive.java
|
||||
* @compile/fail/ref=ExpressionSwitchNotExhaustive.out -XDrawDiagnostics --enable-preview -source 13 ExpressionSwitchNotExhaustive.java
|
||||
*/
|
||||
|
||||
public class ExpressionSwitchNotExhaustive {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8206986
|
||||
* @summary Verify reachability in switch expressions.
|
||||
* @compile/fail/ref=ExpressionSwitchUnreachable.out -XDrawDiagnostics --enable-preview -source 12 ExpressionSwitchUnreachable.java
|
||||
* @compile/fail/ref=ExpressionSwitchUnreachable.out -XDrawDiagnostics --enable-preview -source 13 ExpressionSwitchUnreachable.java
|
||||
*/
|
||||
|
||||
public class ExpressionSwitchUnreachable {
|
||||
|
@ -67,7 +67,7 @@ public class ParseIncomplete {
|
||||
StringWriter out = new StringWriter();
|
||||
try {
|
||||
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
|
||||
List.of("-XDdev", "--enable-preview", "-source", "12"), null,
|
||||
List.of("-XDdev", "--enable-preview", "-source", "13"), null,
|
||||
Arrays.asList(new MyFileObject(code)));
|
||||
ct.parse().iterator().next();
|
||||
} catch (Throwable t) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8206986
|
||||
* @summary Verify the parser handles broken input gracefully.
|
||||
* @compile/fail/ref=ParserRecovery.out -XDrawDiagnostics --enable-preview -source 12 ParserRecovery.java
|
||||
* @compile/fail/ref=ParserRecovery.out -XDrawDiagnostics --enable-preview -source 13 ParserRecovery.java
|
||||
*/
|
||||
|
||||
public class ParserRecovery {
|
||||
|
@ -26,7 +26,7 @@
|
||||
* @bug 8214113
|
||||
* @summary Verify the switch expression's type does not have a constant attached,
|
||||
* and so the switch expression is not elided.
|
||||
* @compile --enable-preview --source 12 SwitchExpressionIsNotAConstant.java
|
||||
* @compile --enable-preview --source 13 SwitchExpressionIsNotAConstant.java
|
||||
* @run main/othervm --enable-preview SwitchExpressionIsNotAConstant
|
||||
*/
|
||||
public class SwitchExpressionIsNotAConstant {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8206986
|
||||
* @summary Verify that scopes in rule cases are isolated.
|
||||
* @compile/fail/ref=SwitchExpressionScopesIsolated.out -XDrawDiagnostics --enable-preview -source 12 SwitchExpressionScopesIsolated.java
|
||||
* @compile/fail/ref=SwitchExpressionScopesIsolated.out -XDrawDiagnostics --enable-preview -source 13 SwitchExpressionScopesIsolated.java
|
||||
*/
|
||||
|
||||
public class SwitchExpressionScopesIsolated {
|
||||
|
@ -89,7 +89,7 @@ public class SwitchExpressionSimpleVisitorTest {
|
||||
|
||||
StringWriter out = new StringWriter();
|
||||
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
|
||||
List.of("--enable-preview", "-source", "12"), null,
|
||||
List.of("--enable-preview", "-source", "13"), null,
|
||||
Arrays.asList(new MyFileObject(code)));
|
||||
return ct.parse().iterator().next();
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
* @test
|
||||
* @bug 8214114
|
||||
* @summary Verify try-catch inside a switch expression works properly.
|
||||
* @compile --enable-preview -source 12 TryCatch.java
|
||||
* @compile --enable-preview -source 13 TryCatch.java
|
||||
* @run main/othervm --enable-preview TryCatch
|
||||
*/
|
||||
public class TryCatch {
|
||||
|
@ -136,7 +136,7 @@ public class CaseTest {
|
||||
|
||||
StringWriter out = new StringWriter();
|
||||
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
|
||||
List.of("-XDdev", "--enable-preview", "-source", "12"), null,
|
||||
List.of("-XDdev", "--enable-preview", "-source", "13"), null,
|
||||
Arrays.asList(new MyFileObject(code)));
|
||||
return ct.parse().iterator().next();
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @bug 8206986
|
||||
* @summary Verify cases with multiple labels work properly.
|
||||
* @compile/fail/ref=MultipleLabelsExpression-old.out -source 9 -Xlint:-options -XDrawDiagnostics MultipleLabelsExpression.java
|
||||
* @compile --enable-preview -source 12 MultipleLabelsExpression.java
|
||||
* @compile --enable-preview -source 13 MultipleLabelsExpression.java
|
||||
* @run main/othervm --enable-preview MultipleLabelsExpression
|
||||
*/
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @bug 8206986
|
||||
* @summary Verify cases with multiple labels work properly.
|
||||
* @compile/fail/ref=MultipleLabelsStatement-old.out -source 9 -Xlint:-options -XDrawDiagnostics MultipleLabelsStatement.java
|
||||
* @compile --enable-preview -source 12 MultipleLabelsStatement.java
|
||||
* @compile --enable-preview -source 13 MultipleLabelsStatement.java
|
||||
* @run main/othervm --enable-preview MultipleLabelsStatement
|
||||
*/
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class RuleParsingTest {
|
||||
|
||||
StringWriter out = new StringWriter();
|
||||
JavacTask ct = (JavacTask) tool.getTask(out, null, noErrors,
|
||||
List.of("--enable-preview", "-source", "12"), null,
|
||||
List.of("--enable-preview", "-source", "13"), null,
|
||||
Arrays.asList(new MyFileObject(code.toString())));
|
||||
CompilationUnitTree cut = ct.parse().iterator().next();
|
||||
Trees trees = Trees.instance(ct);
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @bug 8206986
|
||||
* @summary Verify reasonable errors are produced when neither ':' nor '->'
|
||||
* is found are the expression of a case
|
||||
* @compile/fail/ref=SwitchArrowBrokenConstant.out -source 12 --enable-preview -Xlint:-preview -XDrawDiagnostics SwitchArrowBrokenConstant.java
|
||||
* @compile/fail/ref=SwitchArrowBrokenConstant.out -source 13 --enable-preview -Xlint:-preview -XDrawDiagnostics SwitchArrowBrokenConstant.java
|
||||
*/
|
||||
|
||||
public class SwitchArrowBrokenConstant {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user