--- old/make/common/SetupJavaCompilers.gmk 2017-12-11 22:32:47.042062158 -0800 +++ new/make/common/SetupJavaCompilers.gmk 2017-12-11 22:32:46.710062143 -0800 @@ -69,7 +69,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \ JVM := $(JAVA_JAVAC), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := -source 10 -target 10 --doclint-format html5 \ + FLAGS := -source 11 -target 11 --doclint-format html5 \ -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) @@ -79,7 +79,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \ JVM := $(JAVA_JAVAC), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := -source 10 -target 10 \ + FLAGS := -source 11 -target 11 \ -encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) --- old/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java 2017-12-11 22:32:47.930062197 -0800 +++ new/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java 2017-12-11 22:32:47.586062182 -0800 @@ -159,7 +159,15 @@ * * @since 10 */ - RELEASE_10; + RELEASE_10, + + /** + * The version recognized by the Java Platform, Standard Edition + * 11. + * + * @since 11 + */ + RELEASE_11; // Note that when adding constants for newer releases, the // behavior of latest() and latestSupported() must be updated too. @@ -170,7 +178,7 @@ * @return the latest source version that can be modeled */ public static SourceVersion latest() { - return RELEASE_10; + return RELEASE_11; } private static final SourceVersion latestSupported = getLatestSupported(); @@ -180,6 +188,8 @@ String specVersion = System.getProperty("java.specification.version"); switch (specVersion) { + case "11": + return RELEASE_11; case "10": return RELEASE_10; case "9": --- old/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java 2017-12-11 22:32:48.598062226 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java 2017-12-11 22:32:48.254062211 -0800 @@ -79,7 +79,10 @@ JDK9("9"), /** 1.10 covers the to be determined language features that will be added in JDK 10. */ - JDK10("10"); + JDK10("10"), + + /** 1.11 covers the to be determined language features that will be added in JDK 11. */ + JDK11("11"); private static final Context.Key sourceKey = new Context.Key<>(); @@ -108,6 +111,7 @@ tab.put("1.8", JDK8); // Make 8 an alias for 1.8 tab.put("1.9", JDK9); // Make 9 an alias for 1.9 tab.put("1.10", JDK10); // Make 10 an alias for 1.10 + // Decline to make 1.11 an alias for 11. } private Source(String name) { @@ -125,6 +129,7 @@ } public Target requiredTarget() { + 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; if (this.compareTo(JDK8) >= 0) return Target.JDK1_8; @@ -247,6 +252,8 @@ return RELEASE_9; case JDK10: return RELEASE_10; + case JDK11: + return RELEASE_11; default: return null; } --- old/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Profile.java 2017-12-11 22:32:49.246062255 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Profile.java 2017-12-11 22:32:48.910062240 -0800 @@ -40,9 +40,9 @@ * deletion without notice. */ public enum Profile { - COMPACT1("compact1", 1, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10), - COMPACT2("compact2", 2, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10), - COMPACT3("compact3", 3, Target.JDK1_8, Target.JDK1_9, Target.JDK1_10), + 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), DEFAULT { @Override --- old/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java 2017-12-11 22:32:49.894062283 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java 2017-12-11 22:32:49.550062268 -0800 @@ -64,7 +64,10 @@ JDK1_9("1.9", 53, 0), /** JDK 10. */ - JDK1_10("1.10", 54, 0); + JDK1_10("1.10", 54, 0), + + /** JDK 11. */ + JDK1_11("11", 54, 0); // Initially an alias for JDK_10 private static final Context.Key targetKey = new Context.Key<>(); @@ -95,6 +98,7 @@ tab.put("8", JDK1_8); tab.put("9", JDK1_9); tab.put("10", JDK1_10); + tab.put("11", JDK1_11); } public final String name; --- old/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java 2017-12-11 22:32:50.790062323 -0800 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java 2017-12-11 22:32:50.426062307 -0800 @@ -55,7 +55,7 @@ * deletion without notice. */ @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_10) +@SupportedSourceVersion(SourceVersion.RELEASE_11) public class PrintingProcessor extends AbstractProcessor { PrintWriter writer; --- old/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java 2017-12-11 22:32:51.950062374 -0800 +++ new/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java 2017-12-11 22:32:51.590062358 -0800 @@ -50,7 +50,7 @@ import javax.tools.Diagnostic; -import static javax.lang.model.SourceVersion.RELEASE_10; +import static javax.lang.model.SourceVersion.RELEASE_11; /** * Annotation processor for the Deprecation Scanner tool. @@ -58,7 +58,7 @@ * */ @SupportedAnnotationTypes("java.lang.Deprecated") -@SupportedSourceVersion(RELEASE_10) +@SupportedSourceVersion(RELEASE_11) public class LoadProc extends AbstractProcessor { Elements elements; Messager messager; --- old/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java 2017-12-11 22:32:52.906062416 -0800 +++ new/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java 2017-12-11 22:32:52.534062400 -0800 @@ -106,7 +106,7 @@ // Keep these updated manually until there's a compiler API // that allows querying of supported releases. final Set releasesWithoutForRemoval = Set.of("6", "7", "8"); - final Set releasesWithForRemoval = Set.of("9", "10"); + final Set releasesWithForRemoval = Set.of("9", "10", "11"); final Set validReleases; { @@ -358,14 +358,15 @@ * Process classes from a particular JDK release, using only information * in this JDK. * - * @param release "6", "7", "8", "9", or "10" + * @param release "6", "7", "8", "9", "10", or "11" * @param classes collection of classes to process, may be empty * @return success value */ boolean processRelease(String release, Collection classes) throws IOException { options.addAll(List.of("--release", release)); - if (release.equals("9") || release.equals("10")) { + if (release.equals("9") || release.equals("10") || + release.equals("11")) { List rootMods = List.of("java.se", "java.se.ee"); TraverseProc proc = new TraverseProc(rootMods); JavaCompiler.CompilationTask task = @@ -481,7 +482,7 @@ String dir = null; String jar = null; String jdkHome = null; - String release = "10"; + String release = "11"; List loadClasses = new ArrayList<>(); String csvFile = null; --- old/test/langtools/ProblemList.txt 2017-12-11 22:32:53.602062447 -0800 +++ new/test/langtools/ProblemList.txt 2017-12-11 22:32:53.206062429 -0800 @@ -57,6 +57,7 @@ tools/javac/annotations/typeAnnotations/referenceinfos/NestedTypes.java 8057687 generic-all emit correct byte code an attributes for type annotations tools/javac/warnings/suppress/TypeAnnotations.java 8057683 generic-all improve ordering of errors with type annotations tools/javac/modules/SourceInSymlinkTest.java 8180263 windows-all fails when run on a subst drive +tools/javac/options/release/ReleaseOptionUnsupported.java 8888888 generic-all temporary until support for --release 11 is worked out ########################################################################### # @@ -79,3 +80,5 @@ ########################################################################### # # jdeps + +tools/jdeprscan/tests/jdk/jdeprscan/TestNotFound.java 8888888 generic-all temporary until support for --release 11 is worked out --- old/test/langtools/tools/javac/api/T6265137.java 2017-12-11 22:32:54.478062485 -0800 +++ new/test/langtools/tools/javac/api/T6265137.java 2017-12-11 22:32:54.130062470 -0800 @@ -52,7 +52,7 @@ String srcdir = System.getProperty("test.src"); Iterable files = fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(srcdir, "T6265137a.java"))); - javac.getTask(null, fm, dl, Arrays.asList("-target","10"), null, files).call(); + javac.getTask(null, fm, dl, Arrays.asList("-target","11"), null, files).call(); } } } --- old/test/langtools/tools/javac/api/T6395981.java 2017-12-11 22:32:55.402062526 -0800 +++ new/test/langtools/tools/javac/api/T6395981.java 2017-12-11 22:32:55.026062509 -0800 @@ -23,7 +23,7 @@ /* * @test - * @bug 6395981 6458819 7025784 8028543 8028544 + * @bug 6395981 6458819 7025784 8028543 8028544 8193291 * @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 + * @run main T6395981 RELEASE_3 RELEASE_4 RELEASE_5 RELEASE_6 RELEASE_7 RELEASE_8 RELEASE_9 RELEASE_10 RELEASE_11 */ import java.util.EnumSet; --- old/test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java 2017-12-11 22:32:56.386062569 -0800 +++ new/test/langtools/tools/javac/lib/JavacTestingAbstractProcessor.java 2017-12-11 22:32:55.958062551 -0800 @@ -110,7 +110,7 @@ * corresponding platform visitor type. */ - @SupportedSourceVersion(RELEASE_10) + @SupportedSourceVersion(RELEASE_11) public static abstract class AbstractAnnotationValueVisitor extends AbstractAnnotationValueVisitor9 { /** @@ -121,7 +121,7 @@ } } - @SupportedSourceVersion(RELEASE_10) + @SupportedSourceVersion(RELEASE_11) public static abstract class AbstractElementVisitor extends AbstractElementVisitor9 { /** * Constructor for concrete subclasses to call. @@ -131,7 +131,7 @@ } } - @SupportedSourceVersion(RELEASE_10) + @SupportedSourceVersion(RELEASE_11) public static abstract class AbstractTypeVisitor extends AbstractTypeVisitor9 { /** * Constructor for concrete subclasses to call. @@ -141,7 +141,7 @@ } } - @SupportedSourceVersion(RELEASE_10) + @SupportedSourceVersion(RELEASE_11) public static class ElementKindVisitor extends ElementKindVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -162,7 +162,7 @@ } } - @SupportedSourceVersion(RELEASE_10) + @SupportedSourceVersion(RELEASE_11) public static class ElementScanner extends ElementScanner9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -181,7 +181,7 @@ } } - @SupportedSourceVersion(RELEASE_10) + @SupportedSourceVersion(RELEASE_11) public static class SimpleAnnotationValueVisitor extends SimpleAnnotationValueVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -202,7 +202,7 @@ } } - @SupportedSourceVersion(RELEASE_10) + @SupportedSourceVersion(RELEASE_11) public static class SimpleElementVisitor extends SimpleElementVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -223,7 +223,7 @@ } } - @SupportedSourceVersion(RELEASE_10) + @SupportedSourceVersion(RELEASE_11) public static class SimpleTypeVisitor extends SimpleTypeVisitor9 { /** * Constructor for concrete subclasses; uses {@code null} for the @@ -244,7 +244,7 @@ } } - @SupportedSourceVersion(RELEASE_10) + @SupportedSourceVersion(RELEASE_11) public static class TypeKindVisitor extends TypeKindVisitor9 { /** * Constructor for concrete subclasses to call; uses {@code null} --- old/test/langtools/tools/javac/processing/model/TestSourceVersion.java 2017-12-11 22:32:57.382062613 -0800 +++ new/test/langtools/tools/javac/processing/model/TestSourceVersion.java 2017-12-11 22:32:57.034062598 -0800 @@ -23,7 +23,7 @@ /* * @test - * @bug 7025809 8028543 6415644 8028544 8029942 + * @bug 7025809 8028543 6415644 8028544 8029942 8193291 * @summary Test latest, latestSupported, underscore as keyword, etc. * @author Joseph D. Darcy * @modules java.compiler @@ -45,7 +45,7 @@ } private static void testLatestSupported() { - if (SourceVersion.latest() != RELEASE_10 || + if (SourceVersion.latest() != RELEASE_11 || SourceVersion.latestSupported() != RELEASE_10) throw new RuntimeException("Unexpected release value(s) found:\n" + "latest:\t" + SourceVersion.latest() + "\n" + --- old/test/langtools/tools/javac/profiles/ProfileOptionTest.java 2017-12-11 22:32:58.018062641 -0800 +++ new/test/langtools/tools/javac/profiles/ProfileOptionTest.java 2017-12-11 22:32:57.666062626 -0800 @@ -149,6 +149,7 @@ break; case JDK1_9: case JDK1_10: + case JDK1_11: if (p == Profile.DEFAULT) break; if (ise == null) --- old/test/langtools/tools/javac/versions/Versions.java 2017-12-11 22:32:58.678062670 -0800 +++ new/test/langtools/tools/javac/versions/Versions.java 2017-12-11 22:32:58.298062654 -0800 @@ -23,7 +23,7 @@ /* * @test - * @bug 4981566 5028634 5094412 6304984 7025786 7025789 8001112 8028545 8000961 8030610 8028546 8188870 + * @bug 4981566 5028634 5094412 6304984 7025786 7025789 8001112 8028545 8000961 8030610 8028546 8188870 8173382 * @summary Check interpretation of -target and -source options * @modules java.compiler * jdk.compiler @@ -70,22 +70,24 @@ check("54.0", "-source 1.8"); check("54.0", "-source 1.9"); check("54.0", "-source 1.10"); + check("54.0", "-source 11"); - check_source_target("50.0", "6", "6"); - check_source_target("51.0", "6", "7"); - check_source_target("51.0", "7", "7"); - check_source_target("52.0", "6", "8"); - check_source_target("52.0", "7", "8"); - check_source_target("52.0", "8", "8"); - check_source_target("53.0", "6", "9"); - check_source_target("53.0", "7", "9"); - check_source_target("53.0", "8", "9"); - check_source_target("53.0", "9", "9"); - check_source_target("54.0", "6", "10"); - check_source_target("54.0", "7", "10"); - check_source_target("54.0", "8", "10"); - check_source_target("54.0", "9", "10"); - check_source_target("54.0", "10", "10"); + check_source_target(true, "50.0", "6", "6"); + check_source_target(true, "51.0", "6", "7"); + check_source_target(true, "51.0", "7", "7"); + check_source_target(true, "52.0", "6", "8"); + check_source_target(true, "52.0", "7", "8"); + check_source_target(true, "52.0", "8", "8"); + check_source_target(true, "53.0", "6", "9"); + check_source_target(true, "53.0", "7", "9"); + check_source_target(true, "53.0", "8", "9"); + check_source_target(true, "53.0", "9", "9"); + check_source_target(true, "54.0", "6", "10"); + check_source_target(true, "54.0", "7", "10"); + check_source_target(true, "54.0", "8", "10"); + check_source_target(true, "54.0", "9", "10"); + check_source_target(true, "54.0", "10", "10"); + check_source_target(false, "54.0", "11", "11"); checksrc16("-source 1.6"); checksrc16("-source 6"); @@ -108,8 +110,9 @@ checksrc110("-source 10"); checksrc110("-source 1.10", "-target 1.10"); checksrc110("-source 10", "-target 10"); - checksrc110("-target 1.10"); - checksrc110("-target 10"); + checksrc111("-source 11"); + checksrc111("-source 11", "-target 11"); + checksrc111("-target 11"); fail("-source 7", "-target 1.6", "Base.java"); fail("-source 8", "-target 1.6", "Base.java"); @@ -118,6 +121,8 @@ fail("-source 9", "-target 1.8", "Base.java"); fail("-source 10", "-target 1.7", "Base.java"); 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 1.5", "-target 1.5", "Base.java"); fail("-source 1.4", "-target 1.4", "Base.java"); @@ -139,20 +144,24 @@ System.out.printf("\n", fname); } - protected void check_source_target(String... args) { + protected void check_source_target(boolean dotOne, String... args) { printargs("check_source_target", args); - check_target(args[0], args[1], args[2]); - check_target(args[0], "1." + args[1], args[2]); + check_target(dotOne, args[0], args[1], args[2]); + if (dotOne) { + check_target(dotOne, args[0], "1." + args[1], args[2]); + } } - protected void check_target(String... args) { + protected void check_target(boolean dotOne, String... args) { check(args[0], "-source " + args[1], "-target " + args[2]); - check(args[0], "-source " + args[1], "-target 1." + args[2]); + if (dotOne) { + check(args[0], "-source " + args[1], "-target 1." + args[2]); + } } protected void check(String major, String... args) { printargs("check", args); - List jcargs = new ArrayList(); + List jcargs = new ArrayList<>(); jcargs.add("-Xlint:-options"); // add in args conforming to List requrements of JavaCompiler @@ -207,6 +216,8 @@ pass(newargs); newargs[asize] = "New18.java"; pass(newargs); + newargs[asize] = "New110.java"; + fail(newargs); } protected void checksrc19(String... args) { @@ -216,7 +227,20 @@ protected void checksrc110(String... args) { printargs("checksrc110", args); - checksrc19(args); + int asize = args.length; + String[] newargs = new String[asize+1]; + System.arraycopy(args, 0, newargs,0 , asize); + newargs[asize] = "New17.java"; + pass(newargs); + newargs[asize] = "New18.java"; + pass(newargs); + newargs[asize] = "New110.java"; + pass(newargs); + } + + protected void checksrc111(String... args) { + printargs("checksrc111", args); + checksrc110(args); } protected void pass(String... args) { @@ -346,6 +370,17 @@ " } \n" + "} \n" ); + + /* + * Create a file with a new feature in 1.10, not in 1.9 : var + */ + writeSourceFile("New110.java", + "public class New110 { \n" + + " void m() { \n" + + " var tmp = new Thread(() -> { }); \n" + + " } \n" + + "} \n" + ); }