Merge
authorprr
Fri, 02 Feb 2018 10:32:59 -0800
changeset 48736 0454688cc319
parent 48735 7c63eefd620a (current diff)
parent 48724 9a00756a58d0 (diff)
child 48737 7c12219870fd
child 49079 05077701f689
Merge
test/jdk/ProblemList.txt
--- a/test/jdk/ProblemList.txt	Fri Feb 02 09:04:45 2018 -0800
+++ b/test/jdk/ProblemList.txt	Fri Feb 02 10:32:59 2018 -0800
@@ -333,6 +333,8 @@
 
 # jdk_nio
 
+java/nio/Buffer/EqualsCompareTest.java                          8193917 solaris-all
+
 java/nio/channels/Selector/Wakeup.java                          6963118 windows-all
 
 java/nio/channels/DatagramChannel/ChangingAddress.java          7141822 macosx-all
--- a/test/langtools/tools/javac/file/MultiReleaseJar/MultiReleaseJarAwareSJFM.java	Fri Feb 02 09:04:45 2018 -0800
+++ b/test/langtools/tools/javac/file/MultiReleaseJar/MultiReleaseJarAwareSJFM.java	Fri Feb 02 10:32:59 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8149757 8144062
+ * @bug 8149757 8144062 8196627
  * @summary Test that StandardJavaFileManager uses the correct version of a
  * class from a multi-release jar on classpath
  * @library /tools/lib
@@ -56,6 +56,7 @@
 import toolbox.ToolBox;
 
 public class MultiReleaseJarAwareSJFM {
+    private static final int CURRENT_VERSION = Runtime.version().major();
 
     private final String version8 =
             "package version;\n" +
@@ -86,12 +87,12 @@
             "    }\n" +
             "}\n";
 
-    private final String version10 =
+    private final String versionCurrent =
             "package version;\n" +
             "\n" +
             "public class Version {\n" +
             "    public int getVersion() {\n" +
-            "        return 10;\n" +
+            "        return " + CURRENT_VERSION +";\n" +
             "    }\n" +
             "}\n";
 
@@ -116,7 +117,7 @@
     public void setup() throws Exception {
         tb.createDirectories("classes",
                 "classes/META-INF/versions/9",
-                "classes/META-INF/versions/10");
+                "classes/META-INF/versions/" + CURRENT_VERSION);
         new JavacTask(tb)
                 .outdir("classes")
                 .sources(version8)
@@ -126,8 +127,8 @@
                 .sources(version9, packagePrivate)
                 .run();
         new JavacTask(tb)
-                .outdir("classes/META-INF/versions/10")
-                .sources(version10)
+                .outdir("classes/META-INF/versions/" + CURRENT_VERSION)
+                .sources(versionCurrent)
                 .run();
         new JarTask(tb, "multi-release.jar")
                 .manifest(manifest)
@@ -135,16 +136,16 @@
                 .files("version/Version.class",
                         "META-INF/versions/9/version/Version.class",
                         "META-INF/versions/9/version/PackagePrivate.class",
-                        "META-INF/versions/10/version/Version.class")
+                        "META-INF/versions/" + CURRENT_VERSION + "/version/Version.class")
                 .run();
     }
 
     @AfterClass
     public void teardown() throws Exception {
         tb.deleteFiles(
-                "classes/META-INF/versions/10/version/Version.class",
-                "classes/META-INF/versions/10/version",
-                "classes/META-INF/versions/10/",
+                "classes/META-INF/versions/" + CURRENT_VERSION + "/version/Version.class",
+                "classes/META-INF/versions/" + CURRENT_VERSION + "/version",
+                "classes/META-INF/versions/" + CURRENT_VERSION,
                 "classes/META-INF/versions/9/version/Version.class",
                 "classes/META-INF/versions/9/version/PackagePrivate.class",
                 "classes/META-INF/versions/9/version",
--- a/test/langtools/tools/javac/modules/JavaBaseTest.java	Fri Feb 02 09:04:45 2018 -0800
+++ b/test/langtools/tools/javac/modules/JavaBaseTest.java	Fri Feb 02 10:32:59 2018 -0800
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 8193125
+ * @bug 8193125 8196623
  * @summary test modifiers with java.base
  * @library /tools/lib
  * @modules
@@ -66,10 +66,7 @@
         List.of("static", "transitive")
     );
 
-    final String specVersion = System.getProperty("java.specification.version");
-    final List<String> targets = specVersion.equals("10")
-            ? List.of("9", "10")
-            : List.of("9", "10", specVersion);
+    final List<String> targets = List.of("9", "10", "current");
 
     enum Mode { SOURCE, CLASS };
 
@@ -121,13 +118,18 @@
         Path modules = Files.createDirectories(base.resolve("modules"));
         boolean expectOK = target.equals("9");
 
-        String log = new JavacTask(tb)
-                .outdir(modules)
-                .options("-XDrawDiagnostics", "--release", target)
-                .files(tb.findJavaFiles(src))
-                .run(expectOK ? Task.Expect.SUCCESS : Task.Expect.FAIL)
-                .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
+        JavacTask jct = new JavacTask(tb)
+            .outdir(modules);
+
+        if (target.equals("current"))
+            jct.options("-XDrawDiagnostics");
+        else
+            jct.options("-XDrawDiagnostics", "--release", target);
+
+        String log = jct.files(tb.findJavaFiles(src))
+            .run(expectOK ? Task.Expect.SUCCESS : Task.Expect.FAIL)
+            .writeAll()
+            .getOutput(Task.OutputKind.DIRECT);
 
         if (!expectOK) {
             boolean foundErrorMessage = false;
@@ -189,12 +191,15 @@
                 "module m { requires java.base; }");
         Path modules1 = Files.createDirectories(base.resolve("interim-modules"));
 
-        new JavacTask(tb)
-                .outdir(modules1)
-                .options("--release", target)
-                .files(tb.findJavaFiles(src1))
-                .run(Task.Expect.SUCCESS)
-                .writeAll();
+        JavacTask jct = new JavacTask(tb)
+            .outdir(modules1);
+
+        if (!target.equals("current")) {
+            jct.options("--release", target);
+        }
+
+        jct.files(tb.findJavaFiles(src1))
+            .run(Task.Expect.SUCCESS);
 
         ClassFile cf1 = ClassFile.read(modules1.resolve("module-info.class"));