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