8205615: Start of release updates for JDK 12
8205621: Increment JDK version for JDK 12 8193292: Add SourceVersion.RELEASE_12 8193290: Add source 12 and target 12 to javac 8205619: Bump maximum recognized class file version to 56 for JDK 12 Co-authored-by: Erik Joelsson <erik.joelsson@oracle.com> Co-authored-by: Mikael Vidstedt <mikael.vidstedt@oracle.com> Reviewed-by: alanb, smarks, jjg, mr, erikj, psandoz, dholmes
This commit is contained in:
parent
bc45576579
commit
e56162b43d
@ -25,14 +25,14 @@
|
||||
|
||||
# Default version numbers to use unless overridden by configure
|
||||
|
||||
DEFAULT_VERSION_FEATURE=11
|
||||
DEFAULT_VERSION_FEATURE=12
|
||||
DEFAULT_VERSION_INTERIM=0
|
||||
DEFAULT_VERSION_UPDATE=0
|
||||
DEFAULT_VERSION_PATCH=0
|
||||
DEFAULT_VERSION_DATE=2018-09-25
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_DATE=2019-03-19
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=56 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11"
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11 12"
|
||||
|
||||
LAUNCHER_NAME=openjdk
|
||||
PRODUCT_NAME=OpenJDK
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -72,7 +72,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
|
||||
JVM := $(JAVA_JAVAC), \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
FLAGS := -source 11 -target 11 --doclint-format html5 \
|
||||
FLAGS := -source 12 -target 12 --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 11 -target 11 \
|
||||
FLAGS := -source 12 -target 12 \
|
||||
-encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
|
@ -117,6 +117,8 @@
|
||||
|
||||
#define JAVA_11_VERSION 55
|
||||
|
||||
#define JAVA_12_VERSION 56
|
||||
|
||||
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");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -49,6 +49,7 @@ class Constants {
|
||||
1.9 to 1.9.X 53,0
|
||||
1.10 to 1.10.X 54,0
|
||||
1.11 to 1.11.X 55,0
|
||||
1.12 to 1.12.X 56,0
|
||||
*/
|
||||
|
||||
public static final Package.Version JAVA_MIN_CLASS_VERSION =
|
||||
@ -75,6 +76,9 @@ class Constants {
|
||||
public static final Package.Version JAVA11_MAX_CLASS_VERSION =
|
||||
Package.Version.of(55, 00);
|
||||
|
||||
public static final Package.Version JAVA12_MAX_CLASS_VERSION =
|
||||
Package.Version.of(56, 00);
|
||||
|
||||
public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
|
||||
|
||||
public static final Package.Version JAVA5_PACKAGE_VERSION =
|
||||
@ -91,7 +95,7 @@ class Constants {
|
||||
|
||||
// upper limit, should point to the latest class version
|
||||
public static final Package.Version JAVA_MAX_CLASS_VERSION =
|
||||
JAVA11_MAX_CLASS_VERSION;
|
||||
JAVA12_MAX_CLASS_VERSION;
|
||||
|
||||
// upper limit should point to the latest package version, for version info!.
|
||||
public static final Package.Version MAX_PACKAGE_VERSION =
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -64,7 +64,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 = 55;
|
||||
private final int JAVA_MAX_SUPPORTED_VERSION = 56;
|
||||
|
||||
private static final JavaLangModuleAccess JLMA
|
||||
= SharedSecrets.getJavaLangModuleAccess();
|
||||
|
@ -185,7 +185,7 @@ public class ClassReader {
|
||||
public ClassReader(final byte[] b, final int off, final int len) {
|
||||
this.b = b;
|
||||
// checks the class version
|
||||
if (readShort(off + 6) > Opcodes.V11) {
|
||||
if (readShort(off + 6) > Opcodes.V12) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
// parses the constant pool
|
||||
|
@ -91,6 +91,7 @@ public interface Opcodes {
|
||||
int V9 = 0 << 16 | 53;
|
||||
int V10 = 0 << 16 | 54;
|
||||
int V11 = 0 << 16 | 55;
|
||||
int V12 = 0 << 16 | 56;
|
||||
|
||||
// access flags
|
||||
|
||||
|
@ -171,7 +171,15 @@ public enum SourceVersion {
|
||||
*
|
||||
* @since 11
|
||||
*/
|
||||
RELEASE_11;
|
||||
RELEASE_11,
|
||||
|
||||
/**
|
||||
* The version recognized by the Java Platform, Standard Edition
|
||||
* 12.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
RELEASE_12;
|
||||
|
||||
// Note that when adding constants for newer releases, the
|
||||
// behavior of latest() and latestSupported() must be updated too.
|
||||
@ -182,7 +190,7 @@ public enum SourceVersion {
|
||||
* @return the latest source version that can be modeled
|
||||
*/
|
||||
public static SourceVersion latest() {
|
||||
return RELEASE_11;
|
||||
return RELEASE_12;
|
||||
}
|
||||
|
||||
private static final SourceVersion latestSupported = getLatestSupported();
|
||||
@ -192,6 +200,8 @@ public enum SourceVersion {
|
||||
String specVersion = System.getProperty("java.specification.version");
|
||||
|
||||
switch (specVersion) {
|
||||
case "12":
|
||||
return RELEASE_12;
|
||||
case "11":
|
||||
return RELEASE_11;
|
||||
case "10":
|
||||
|
@ -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_11 RELEASE_11}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
*
|
||||
* <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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11 RELEASE_11}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
*
|
||||
* <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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11 RELEASE_11}.
|
||||
* {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
*
|
||||
* <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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11 RELEASE_11}.
|
||||
* SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
*
|
||||
* 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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11 RELEASE_11}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
*
|
||||
* 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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11 RELEASE_11}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
*
|
||||
* 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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11 RELEASE_11}.
|
||||
* RELEASE_9} through {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
*
|
||||
* 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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11 RELEASE_11}.
|
||||
* {@link SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
*
|
||||
* 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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11 RELEASE_11}.
|
||||
* SourceVersion#RELEASE_12 RELEASE_12}.
|
||||
*
|
||||
* 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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
public class TypeKindVisitor9<R, P> extends TypeKindVisitor8<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses to call; uses {@code null}
|
||||
|
@ -81,8 +81,11 @@ public enum Source {
|
||||
/** 1.10 local-variable type inference (var). */
|
||||
JDK10("10"),
|
||||
|
||||
/** 1.11 covers the to be determined language features that will be added in JDK 11. */
|
||||
JDK11("11");
|
||||
/** 1.11 local-variable syntax for lambda parameters */
|
||||
JDK11("11"),
|
||||
|
||||
/** 12 covers the to be determined language features that will be added in JDK 12. */
|
||||
JDK12("12");
|
||||
|
||||
private static final Context.Key<Source> sourceKey = new Context.Key<>();
|
||||
|
||||
@ -129,6 +132,7 @@ public enum Source {
|
||||
}
|
||||
|
||||
public Target requiredTarget() {
|
||||
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;
|
||||
if (this.compareTo(JDK9) >= 0) return Target.JDK1_9;
|
||||
@ -265,6 +269,8 @@ public enum Source {
|
||||
return RELEASE_10;
|
||||
case JDK11:
|
||||
return RELEASE_11;
|
||||
case JDK12:
|
||||
return RELEASE_12;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -115,7 +115,8 @@ public class ClassFile {
|
||||
V52(52, 0), // JDK 1.8: lambda, type annos, param names
|
||||
V53(53, 0), // JDK 1.9: modules, indy string concat
|
||||
V54(54, 0), // JDK 10
|
||||
V55(55, 0); // JDK 11: constant dynamic
|
||||
V55(55, 0), // JDK 11: constant dynamic, nest mates
|
||||
V56(56, 0); // JDK 12
|
||||
Version(int major, int minor) {
|
||||
this.major = major;
|
||||
this.minor = minor;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -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),
|
||||
COMPACT2("compact2", 2, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11),
|
||||
COMPACT3("compact3", 3, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10, Target.JDK1_11),
|
||||
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),
|
||||
|
||||
DEFAULT {
|
||||
@Override
|
||||
|
@ -67,7 +67,10 @@ public enum Target {
|
||||
JDK1_10("1.10", 54, 0),
|
||||
|
||||
/** JDK 11. */
|
||||
JDK1_11("11", 55, 0);
|
||||
JDK1_11("11", 55, 0),
|
||||
|
||||
/** JDK 12. */
|
||||
JDK1_12("12", 56, 0);
|
||||
|
||||
private static final Context.Key<Target> targetKey = new Context.Key<>();
|
||||
|
||||
@ -99,6 +102,7 @@ public enum Target {
|
||||
tab.put("9", JDK1_9);
|
||||
tab.put("10", JDK1_10);
|
||||
tab.put("11", JDK1_11);
|
||||
tab.put("12", JDK1_12);
|
||||
}
|
||||
|
||||
public final String name;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -55,7 +55,7 @@ import com.sun.tools.javac.util.StringUtils;
|
||||
* deletion without notice.</b>
|
||||
*/
|
||||
@SupportedAnnotationTypes("*")
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_11)
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_12)
|
||||
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 = 55; // JDK11
|
||||
private static final int MAJOR_VERSION_JAVA_MAX = 56; // JDK12
|
||||
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");
|
||||
final Set<String> releasesWithForRemoval = Set.of("9", "10", "11", "12");
|
||||
|
||||
final Set<String> validReleases;
|
||||
{
|
||||
@ -496,7 +496,7 @@ public class Main implements DiagnosticListener<JavaFileObject> {
|
||||
String dir = null;
|
||||
String jar = null;
|
||||
String jdkHome = null;
|
||||
String release = "11";
|
||||
String release = Integer.toString(Runtime.version().feature());
|
||||
List<String> loadClasses = new ArrayList<>();
|
||||
String csvFile = null;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -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 = 55;
|
||||
int JAVA_MAX_SUPPORTED_VERSION = 56;
|
||||
int JAVA_MAX_SUPPORTED_MINOR_VERSION = 0;
|
||||
|
||||
/* Generate class file version for 1.1 by default */
|
||||
|
@ -46,13 +46,6 @@ public class VMDeprecatedOptions {
|
||||
{"InitialRAMFraction", "64"},
|
||||
{"AssumeMP", "false"},
|
||||
{"UseMembar", "true"},
|
||||
{"CompilerThreadHintNoPreempt", "true"},
|
||||
{"VMThreadHintNoPreempt", "false"},
|
||||
{"PrintSafepointStatistics", "false"},
|
||||
{"PrintSafepointStatisticsCount", "3"},
|
||||
{"PrintSafepointStatisticsTimeout", "3"},
|
||||
{"AggressiveOpts", "true"},
|
||||
{"AllowNonVirtualCalls", "true"},
|
||||
|
||||
// deprecated alias flags (see also aliased_jvm_flags):
|
||||
{"DefaultMaxRAMFraction", "4"},
|
||||
|
@ -58,7 +58,7 @@ public class CheckOrigin {
|
||||
File flagsFile = File.createTempFile("CheckOriginFlags", null);
|
||||
try (PrintWriter pw =
|
||||
new PrintWriter(new FileWriter(flagsFile))) {
|
||||
pw.println("+PrintSafepointStatistics");
|
||||
pw.println("+PrintVMQWaitTime");
|
||||
}
|
||||
|
||||
ProcessBuilder pb = ProcessTools.
|
||||
@ -108,7 +108,7 @@ public class CheckOrigin {
|
||||
checkOrigin("IgnoreUnrecognizedVMOptions", Origin.ENVIRON_VAR);
|
||||
checkOrigin("PrintVMOptions", Origin.ENVIRON_VAR);
|
||||
// Set in -XX:Flags file
|
||||
checkOrigin("PrintSafepointStatistics", Origin.CONFIG_FILE);
|
||||
checkOrigin("PrintVMQWaitTime", Origin.CONFIG_FILE);
|
||||
// Set through j.l.m
|
||||
checkOrigin("HeapDumpOnOutOfMemoryError", Origin.MANAGEMENT);
|
||||
// Should be set by the VM, when we set UseConcMarkSweepGC
|
||||
|
@ -54,8 +54,8 @@ public class ClassFileVersionsTest {
|
||||
{ 53, 0, Set.of(STATIC, TRANSITIVE) },
|
||||
|
||||
{ 54, 0, Set.of() }, // JDK 10
|
||||
|
||||
{ 55, 0, Set.of()}, // JDK 11
|
||||
{ 55, 0, Set.of() }, // JDK 11
|
||||
{ 56, 0, Set.of() }, // JDK 12
|
||||
};
|
||||
}
|
||||
|
||||
@ -75,7 +75,11 @@ public class ClassFileVersionsTest {
|
||||
{ 55, 0, Set.of(TRANSITIVE) },
|
||||
{ 55, 0, Set.of(STATIC, TRANSITIVE) },
|
||||
|
||||
{ 56, 0, Set.of()}, // JDK 12
|
||||
{ 56, 0, Set.of(STATIC) }, // JDK 12
|
||||
{ 56, 0, Set.of(TRANSITIVE) },
|
||||
{ 56, 0, Set.of(STATIC, TRANSITIVE) },
|
||||
|
||||
{ 57, 0, Set.of()}, // JDK 13
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -64,6 +64,8 @@ public class TestVersionedStream {
|
||||
private final Path userdir;
|
||||
private final Set<String> unversionedEntryNames;
|
||||
|
||||
private static final int LATEST_VERSION = Runtime.version().feature();
|
||||
|
||||
public TestVersionedStream() throws IOException {
|
||||
userdir = Paths.get(System.getProperty("user.dir", "."));
|
||||
|
||||
@ -79,12 +81,14 @@ public class TestVersionedStream {
|
||||
"v9/p/Foo.class",
|
||||
"v10/p/Foo.class",
|
||||
"v10/q/Bar.class",
|
||||
"v11/p/Bar.class",
|
||||
"v11/p/Foo.class"
|
||||
"v" + LATEST_VERSION + "/p/Bar.class",
|
||||
"v" + LATEST_VERSION + "/p/Foo.class"
|
||||
);
|
||||
|
||||
jar("cf mmr.jar -C base . --release 9 -C v9 . " +
|
||||
"--release 10 -C v10 . --release 11 -C v11 .");
|
||||
jar("cf mmr.jar -C base . " +
|
||||
"--release 9 -C v9 . " +
|
||||
"--release 10 -C v10 . " +
|
||||
"--release " + LATEST_VERSION + " -C v" + LATEST_VERSION + " .");
|
||||
|
||||
System.out.println("Contents of mmr.jar\n=======");
|
||||
|
||||
@ -124,7 +128,7 @@ public class TestVersionedStream {
|
||||
{Runtime.Version.parse("8")},
|
||||
{Runtime.Version.parse("9")},
|
||||
{Runtime.Version.parse("10")},
|
||||
{Runtime.Version.parse("11")},
|
||||
{Runtime.Version.parse(Integer.toString(LATEST_VERSION))},
|
||||
{JarFile.baseVersion()},
|
||||
{JarFile.runtimeVersion()}
|
||||
};
|
||||
@ -173,7 +177,8 @@ public class TestVersionedStream {
|
||||
|
||||
expected.put("p/Bar.class", new String[] { "base/p/Bar.class", "p/Bar.class" });
|
||||
expected.put("p/Main.class", new String[] { "base/p/Main.class", "p/Main.class" });
|
||||
switch (version.major()) {
|
||||
int majorVersion = version.major();
|
||||
switch (majorVersion) {
|
||||
case 8:
|
||||
expected.put("p/Foo.class", new String[]
|
||||
{ "base/p/Foo.class", "p/Foo.class" });
|
||||
@ -189,16 +194,19 @@ public class TestVersionedStream {
|
||||
expected.put("q/Bar.class", new String[]
|
||||
{ "v10/q/Bar.class", "META-INF/versions/10/q/Bar.class" });
|
||||
break;
|
||||
case 11:
|
||||
expected.put("p/Bar.class", new String[]
|
||||
{ "v11/p/Bar.class", "META-INF/versions/11/p/Bar.class"});
|
||||
expected.put("p/Foo.class", new String[]
|
||||
{ "v11/p/Foo.class", "META-INF/versions/11/p/Foo.class"});
|
||||
expected.put("q/Bar.class", new String[]
|
||||
{ "q/Bar.class", "META-INF/versions/10/q/Bar.class"});
|
||||
break;
|
||||
default:
|
||||
Assert.fail("Test out of date, please add more cases");
|
||||
if (majorVersion == LATEST_VERSION) {
|
||||
expected.put("p/Bar.class",
|
||||
new String[] { "v" + LATEST_VERSION + "/p/Bar.class",
|
||||
"META-INF/versions/" + LATEST_VERSION + "/p/Bar.class"});
|
||||
expected.put("p/Foo.class",
|
||||
new String[]{ "v" + LATEST_VERSION + "/p/Foo.class",
|
||||
"META-INF/versions/" + LATEST_VERSION + "/p/Foo.class"});
|
||||
expected.put("q/Bar.class",
|
||||
new String[] { "q/Bar.class", "META-INF/versions/10/q/Bar.class"});
|
||||
} else {
|
||||
Assert.fail("Test out of date, please add more cases");
|
||||
}
|
||||
}
|
||||
|
||||
expected.entrySet().stream().forEach(e -> {
|
||||
|
@ -116,7 +116,8 @@ public class MultiReleaseJarTest {
|
||||
return new Object[][] {
|
||||
{Version.parse("8"), 8},
|
||||
{Version.parse("9"), 9},
|
||||
{Version.parse("11"), MAJOR_VERSION},
|
||||
{Version.parse(Integer.toString(MAJOR_VERSION)), MAJOR_VERSION},
|
||||
{Version.parse(Integer.toString(MAJOR_VERSION) + 1), MAJOR_VERSION},
|
||||
{Version.parse("100"), MAJOR_VERSION}
|
||||
};
|
||||
}
|
||||
|
@ -56,6 +56,9 @@ tools/javac/warnings/suppress/TypeAnnotations.java
|
||||
tools/javac/modules/SourceInSymlinkTest.java 8180263 windows-all fails when run on a subst drive
|
||||
tools/javac/importscope/T8193717.java 8203925 generic-all the test requires too much memory
|
||||
|
||||
|
||||
tools/javac/options/smokeTests/OptionSmokeTest.java 8205493 generic-all hard-coded release values in strings
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# javap
|
||||
@ -70,12 +73,12 @@ tools/javap/T6587786.java
|
||||
tools/sjavac/IncCompileFullyQualifiedRef.java 8152055 generic-all Requires dependency code to deal with in-method dependencies.
|
||||
tools/sjavac/IncCompileWithChanges.java 8152055 generic-all Requires dependency code to deal with in-method dependencies.
|
||||
|
||||
tools/sjavac/ApiExtraction.java 8158002 generic-all Requires investigation
|
||||
tools/sjavac/IgnoreSymbolFile.java 8158002 generic-all Requires investigation
|
||||
tools/sjavac/ClasspathDependencies.java 8158002 generic-all Requires investigation
|
||||
tools/sjavac/ApiExtraction.java 8158002 generic-all Requires investigation
|
||||
tools/sjavac/IgnoreSymbolFile.java 8158002 generic-all Requires investigation
|
||||
tools/sjavac/ClasspathDependencies.java 8158002 generic-all Requires investigation
|
||||
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# jdeps
|
||||
# jdeps
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 6330997 7025789 8000961 8188870
|
||||
* @bug 6330997 7025789 8000961 8188870 8193290
|
||||
* @summary javac should accept class files with major version of the next release
|
||||
* @author Wei Tao
|
||||
* @modules jdk.compiler/com.sun.tools.javac.api
|
||||
@ -32,8 +32,8 @@
|
||||
* jdk.compiler/com.sun.tools.javac.main
|
||||
* jdk.compiler/com.sun.tools.javac.util
|
||||
* @clean T1 T2
|
||||
* @compile -source 10 -target 11 T1.java
|
||||
* @compile -source 10 -target 11 T2.java
|
||||
* @compile -source 11 -target 12 T1.java
|
||||
* @compile -source 11 -target 12 T2.java
|
||||
* @run main/othervm T6330997
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -52,7 +52,7 @@ public class T6265137 {
|
||||
String srcdir = System.getProperty("test.src");
|
||||
Iterable<? extends JavaFileObject> files =
|
||||
fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(srcdir, "T6265137a.java")));
|
||||
javac.getTask(null, fm, dl, Arrays.asList("-target","11"), null, files).call();
|
||||
javac.getTask(null, fm, dl, Arrays.asList("-target", "12"), null, files).call();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6395981 6458819 7025784 8028543 8028544 8193291
|
||||
* @bug 6395981 6458819 7025784 8028543 8028544 8193291 8193292 8193292
|
||||
* @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
|
||||
* @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7 RELEASE_8 RELEASE_9 RELEASE_10 RELEASE_11 RELEASE_12
|
||||
*/
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 7157626 8001112 8188870 8173382
|
||||
* @bug 7157626 8001112 8188870 8173382 8193290 8205619
|
||||
* @summary Test major version for all legal combinations for -source and -target
|
||||
* @author sgoel
|
||||
*
|
||||
@ -38,7 +38,7 @@ import java.util.regex.*;
|
||||
public class ClassVersionChecker {
|
||||
|
||||
int errors;
|
||||
String[] jdk = {"", "1.6", "1.7", "1.8", "1.9", "1.10", "11"};
|
||||
String[] jdk = {"", "1.6", "1.7", "1.8", "1.9", "1.10", "11", "12"};
|
||||
File javaFile = null;
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
@ -58,12 +58,12 @@ public class ClassVersionChecker {
|
||||
* -1 => invalid combinations
|
||||
*/
|
||||
int[][] ver =
|
||||
{{55, -1, -1, -1, -1, -1, -1},
|
||||
{55, 50, 51, 52, 53, 54, 55},
|
||||
{55, -1, 51, 52, 53, 54, 55},
|
||||
{55, -1, -1, 52, 53, 54, 55},
|
||||
{55, -1, -1, -1, 53, 54, 55},
|
||||
{55, -1, -1, -1, -1, 54, 55}};
|
||||
{{56, -1, -1, -1, -1, -1, -1, -1},
|
||||
{56, 50, 51, 52, 53, 54, 55, 56},
|
||||
{56, -1, 51, 52, 53, 54, 55, 56},
|
||||
{56, -1, -1, 52, 53, 54, 55, 56},
|
||||
{56, -1, -1, -1, 53, 54, 55, 56},
|
||||
{56, -1, -1, -1, -1, 54, 55, 56}};
|
||||
|
||||
// Loop to run all possible combinations of source/target values
|
||||
for (int i = 0; i< ver.length; i++) {
|
||||
|
@ -27,7 +27,7 @@
|
||||
//key: compiler.warn.preview.feature.use.plural
|
||||
//key: compiler.misc.feature.diamond
|
||||
//key: compiler.misc.feature.lambda
|
||||
//options: -Xlint:preview -XDforcePreview -source 11 --enable-preview
|
||||
//options: -Xlint:preview -XDforcePreview -source 12 --enable-preview
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
// key: compiler.note.preview.filename
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: -XDforcePreview -source 11 --enable-preview
|
||||
// options: -XDforcePreview -source 12 --enable-preview
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -26,7 +26,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 11 --enable-preview
|
||||
// options: -Xlint:preview -Xmaxwarns 1 -XDforcePreview -source 12 --enable-preview
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
// key: compiler.note.preview.plural
|
||||
// key: compiler.note.preview.recompile
|
||||
// options: -XDforcePreview -source 11 --enable-preview
|
||||
// options: -XDforcePreview -source 12 --enable-preview
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -110,7 +110,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
* corresponding platform visitor type.
|
||||
*/
|
||||
|
||||
@SupportedSourceVersion(RELEASE_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
public static abstract class AbstractAnnotationValueVisitor<R, P> extends AbstractAnnotationValueVisitor9<R, P> {
|
||||
|
||||
/**
|
||||
@ -121,7 +121,7 @@ public abstract class JavacTestingAbstractProcessor extends AbstractProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
@SupportedSourceVersion(RELEASE_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
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_11)
|
||||
@SupportedSourceVersion(RELEASE_12)
|
||||
public static class TypeKindVisitor<R, P> extends TypeKindVisitor9<R, P> {
|
||||
/**
|
||||
* Constructor for concrete subclasses to call; uses {@code null}
|
||||
|
@ -2,9 +2,9 @@
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8199194
|
||||
* @summary smoke test for --enabled-preview classreader support
|
||||
* @compile -XDforcePreview --enable-preview -source 11 Bar.java
|
||||
* @compile -XDforcePreview --enable-preview -source 12 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 11 Client.java
|
||||
* @compile/fail/ref=Client.preview.out -Werror -Xlint:preview -XDrawDiagnostics --enable-preview -source 12 Client.java
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
|
@ -1,2 +1,2 @@
|
||||
- compiler.err.preview.feature.disabled.classfile: Bar.class, 11
|
||||
- compiler.err.preview.feature.disabled.classfile: Bar.class, 12
|
||||
1 error
|
||||
|
@ -1,4 +1,4 @@
|
||||
- compiler.warn.preview.feature.use.classfile: Bar.class, 11
|
||||
- compiler.warn.preview.feature.use.classfile: Bar.class, 12
|
||||
- compiler.err.warnings.and.werror
|
||||
1 error
|
||||
1 warning
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
/*
|
||||
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -150,6 +150,7 @@ public class ProfileOptionTest {
|
||||
case JDK1_9:
|
||||
case JDK1_10:
|
||||
case JDK1_11:
|
||||
case JDK1_12:
|
||||
if (p == Profile.DEFAULT)
|
||||
break;
|
||||
if (ise == null)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4981566 5028634 5094412 6304984 7025786 7025789 8001112 8028545 8000961 8030610 8028546 8188870 8173382 8173382
|
||||
* @bug 4981566 5028634 5094412 6304984 7025786 7025789 8001112 8028545 8000961 8030610 8028546 8188870 8173382 8173382 8193290 8205619
|
||||
* @summary Check interpretation of -target and -source options
|
||||
* @modules java.compiler
|
||||
* jdk.compiler
|
||||
@ -64,13 +64,15 @@ public class Versions {
|
||||
String TC = "";
|
||||
System.out.println("Version.java: Starting");
|
||||
|
||||
check("55.0");
|
||||
check("55.0", "-source 1.6");
|
||||
check("55.0", "-source 1.7");
|
||||
check("55.0", "-source 1.8");
|
||||
check("55.0", "-source 1.9");
|
||||
check("55.0", "-source 1.10");
|
||||
check("55.0", "-source 11");
|
||||
String LATEST_MAJOR_VERSION = "56.0";
|
||||
check(LATEST_MAJOR_VERSION);
|
||||
check(LATEST_MAJOR_VERSION, "-source 1.6");
|
||||
check(LATEST_MAJOR_VERSION, "-source 1.7");
|
||||
check(LATEST_MAJOR_VERSION, "-source 1.8");
|
||||
check(LATEST_MAJOR_VERSION, "-source 1.9");
|
||||
check(LATEST_MAJOR_VERSION, "-source 1.10");
|
||||
check(LATEST_MAJOR_VERSION, "-source 11");
|
||||
check(LATEST_MAJOR_VERSION, "-source 12");
|
||||
|
||||
check_source_target(true, "50.0", "6", "6");
|
||||
check_source_target(true, "51.0", "6", "7");
|
||||
@ -93,6 +95,7 @@ public class Versions {
|
||||
check_source_target(false, "55.0", "9", "11");
|
||||
check_source_target(false, "55.0", "10", "11");
|
||||
check_source_target(false, "55.0", "11", "11");
|
||||
check_source_target(false, "56.0", "12", "12");
|
||||
|
||||
checksrc16("-source 1.6");
|
||||
checksrc16("-source 6");
|
||||
@ -117,7 +120,9 @@ public class Versions {
|
||||
checksrc110("-source 10", "-target 10");
|
||||
checksrc111("-source 11");
|
||||
checksrc111("-source 11", "-target 11");
|
||||
checksrc111("-target 11");
|
||||
checksrc112("-source 12");
|
||||
checksrc112("-source 12", "-target 12");
|
||||
checksrc112("-target 12");
|
||||
|
||||
fail("-source 7", "-target 1.6", "Base.java");
|
||||
fail("-source 8", "-target 1.6", "Base.java");
|
||||
@ -128,6 +133,8 @@ public class Versions {
|
||||
fail("-source 10", "-target 1.8", "Base.java");
|
||||
fail("-source 11", "-target 1.9", "Base.java");
|
||||
fail("-source 11", "-target 1.10", "Base.java");
|
||||
fail("-source 12", "-target 1.10", "Base.java");
|
||||
fail("-source 12", "-target 11", "Base.java");
|
||||
|
||||
fail("-source 1.5", "-target 1.5", "Base.java");
|
||||
fail("-source 1.4", "-target 1.4", "Base.java");
|
||||
@ -248,6 +255,11 @@ public class Versions {
|
||||
checksrc110(args);
|
||||
}
|
||||
|
||||
protected void checksrc112(String... args) {
|
||||
printargs("checksrc112", args);
|
||||
checksrc111(args);
|
||||
}
|
||||
|
||||
protected void pass(String... args) {
|
||||
printargs("pass", args);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user