Merge
authorduke
Wed, 05 Jul 2017 20:00:03 +0200
changeset 26394 bcf7be47a0ac
parent 26393 290847867ded (diff)
parent 26384 3b419bf4f176 (current diff)
child 26395 b2287cac7813
Merge
hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java
hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp
hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp
hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp
jdk/src/java.desktop/share/conf/cmm/lcms/CIEXYZ.pf
jdk/src/java.desktop/share/conf/cmm/lcms/GRAY.pf
jdk/src/java.desktop/share/conf/cmm/lcms/LINEAR_RGB.pf
jdk/src/java.desktop/share/conf/cmm/lcms/PYCC.pf
jdk/src/java.desktop/share/conf/cmm/lcms/sRGB.pf
jdk/test/java/awt/Mixing/AWT_Mixing/Util.java
nashorn/bin/dump_octane_code.sh
nashorn/bin/fixorphantests.sh
nashorn/bin/fixwhitespace.sh
nashorn/bin/jjsdebug.sh
nashorn/bin/rm-non-tracked.sh
nashorn/bin/run_octane.sh
nashorn/bin/rundiff.sh
nashorn/bin/runopt.sh
nashorn/bin/runopt_noassert.sh
nashorn/bin/runopt_nojfr.sh
--- a/langtools/.hgtags	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/.hgtags	Wed Jul 05 20:00:03 2017 +0200
@@ -271,3 +271,4 @@
 5b20a93f8db0b87b902bde48bb7cbb05e88e6e9c jdk9-b26
 10fc81ac75b445528851c9e46c6eeb4438d4e363 jdk9-b27
 016786f793149135ab6b23c71087c1ca12691d77 jdk9-b28
+13705e2ddeb20a78e066595a1709e61f257189e9 jdk9-b29
--- a/langtools/make/intellij/codeStyleSettings.xml	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/make/intellij/codeStyleSettings.xml	Wed Jul 05 20:00:03 2017 +0200
@@ -3,6 +3,7 @@
   <component name="ProjectCodeStyleSettingsManager">
     <option name="PER_PROJECT_SETTINGS">
       <value>
+        <option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
         <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
         <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
         <option name="RIGHT_MARGIN" value="100" />
--- a/langtools/make/intellij/copyright/profiles_settings.xml	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/make/intellij/copyright/profiles_settings.xml	Wed Jul 05 20:00:03 2017 +0200
@@ -1,3 +1,7 @@
 <component name="CopyrightManager">
-  <settings default="langtools" />
-</component>
\ No newline at end of file
+  <settings default="langtools">
+    <LanguageOptions name="JAVA">
+      <option name="fileLocation" value="1" />
+    </LanguageOptions>
+  </settings>
+</component>
--- a/langtools/make/intellij/workspace.xml	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/make/intellij/workspace.xml	Wed Jul 05 20:00:03 2017 +0200
@@ -142,6 +142,9 @@
       <method />
     </configuration>
   </component>
+  <component name="StructureViewFactory">
+    <option name="ACTIVE_ACTIONS" value=",ALPHA_COMPARATOR" />
+  </component>
   <component name="antWorkspaceConfiguration">
     <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
     <option name="FILTER_TARGETS" value="false" />
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javap/AttributeWriter.java	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javap/AttributeWriter.java	Wed Jul 05 20:00:03 2017 +0200
@@ -297,17 +297,18 @@
                     writeInnerClassHeader();
                     first = false;
                 }
-                print("   ");
                 for (String name: access_flags.getInnerClassModifiers())
                     print(name + " ");
-                if (info.inner_name_index!=0) {
+                if (info.inner_name_index != 0) {
                     print("#" + info.inner_name_index + "= ");
                 }
                 print("#" + info.inner_class_info_index);
                 if (info.outer_class_info_index != 0) {
                     print(" of #" + info.outer_class_info_index);
                 }
-                print("; //");
+                print(";");
+                tab();
+                print("// ");
                 if (info.inner_name_index != 0) {
                     print(getInnerName(constant_pool, info) + "=");
                 }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javap/ConstantWriter.java	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javap/ConstantWriter.java	Wed Jul 05 20:00:03 2017 +0200
@@ -369,9 +369,21 @@
                     case '\r':
                         sb.append('\\').append('r');
                         break;
+                    case '\b':
+                        sb.append('\\').append('b');
+                        break;
+                    case '\f':
+                        sb.append('\\').append('f');
+                        break;
                     case '\"':
                         sb.append('\\').append('\"');
                         break;
+                    case '\'':
+                        sb.append('\\').append('\'');
+                        break;
+                    case '\\':
+                        sb.append('\\').append('\\');
+                        break;
                     default:
                         sb.append(c);
                 }
--- a/langtools/test/com/sun/javadoc/testOrdering/TestOrdering.java	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/test/com/sun/javadoc/testOrdering/TestOrdering.java	Wed Jul 05 20:00:03 2017 +0200
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8039410 8042601 8042829 8049393
+ * @bug 8039410 8042601 8042829 8049393 8050031
  * @summary test to determine if members are ordered correctly
  * @author ksrini
  * @library ../lib/
--- a/langtools/test/tools/all/RunCodingRules.java	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/test/tools/all/RunCodingRules.java	Wed Jul 05 20:00:03 2017 +0200
@@ -30,8 +30,12 @@
 
 import java.io.*;
 import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
 import java.util.*;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import javax.tools.Diagnostic;
 import javax.tools.DiagnosticListener;
@@ -48,25 +52,26 @@
     }
 
     public void run() throws Exception {
-        File testSrc = new File(System.getProperty("test.src", "."));
-        File targetDir = new File(System.getProperty("test.classes", "."));
-        File sourceDir = null;
-        File crulesDir = null;
-        for (File d = testSrc; d != null; d = d.getParentFile()) {
-            if (new File(d, "TEST.ROOT").exists()) {
-                d = d.getParentFile();
-                File f = new File(d, "src/share/classes");
-                if (f.exists()) {
-                    sourceDir = f;
-                    f = new File(d, "make/tools");
-                    if (f.exists())
-                        crulesDir = f;
+        Path testSrc = Paths.get(System.getProperty("test.src", "."));
+        Path targetDir = Paths.get(System.getProperty("test.classes", "."));
+        List<Path> sourceDirs = null;
+        Path crulesDir = null;
+        for (Path d = testSrc; d != null; d = d.getParent()) {
+            if (Files.exists(d.resolve("TEST.ROOT"))) {
+                d = d.getParent();
+                Path toolsPath = d.resolve("make/tools");
+                if (Files.exists(toolsPath)) {
+                    crulesDir = toolsPath;
+                    sourceDirs = Files.walk(d.resolve("src"), 1)
+                                      .map(p -> p.resolve("share/classes"))
+                                      .filter(p -> Files.isDirectory(p))
+                                      .collect(Collectors.toList());
                     break;
                 }
             }
         }
 
-        if (sourceDir == null || crulesDir == null) {
+        if (sourceDirs == null || crulesDir == null) {
             System.err.println("Warning: sources not found, test skipped.");
             return ;
         }
@@ -77,35 +82,43 @@
             Assert.check(diagnostic.getKind() != Diagnostic.Kind.ERROR, diagnostic.toString());
         };
 
-        List<File> crulesFiles = Files.walk(crulesDir.toPath())
+        List<File> crulesFiles = Files.walk(crulesDir)
+                                      .filter(entry -> entry.getFileName().toString().endsWith(".java"))
+                                      .filter(entry -> entry.getParent().endsWith("crules"))
                                       .map(entry -> entry.toFile())
-                                      .filter(entry -> entry.getName().endsWith(".java"))
-                                      .filter(entry -> entry.getParentFile().getName().equals("crules"))
                                       .collect(Collectors.toList());
 
-        File crulesTarget = new File(targetDir, "crules");
-        crulesTarget.mkdirs();
-        List<String> crulesOptions = Arrays.asList("-d", crulesTarget.getAbsolutePath());
+        Path crulesTarget = targetDir.resolve("crules");
+        Files.createDirectories(crulesTarget);
+        List<String> crulesOptions = Arrays.asList("-d", crulesTarget.toString());
         javaCompiler.getTask(null, fm, noErrors, crulesOptions, null,
                 fm.getJavaFileObjectsFromFiles(crulesFiles)).call();
-        File registration = new File(crulesTarget, "META-INF/services/com.sun.source.util.Plugin");
-        registration.getParentFile().mkdirs();
-        try (Writer metaInfServices = new FileWriter(registration)) {
+        Path registration = crulesTarget.resolve("META-INF/services/com.sun.source.util.Plugin");
+        Files.createDirectories(registration.getParent());
+        try (Writer metaInfServices = Files.newBufferedWriter(registration, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) {
             metaInfServices.write("crules.CodingRulesAnalyzerPlugin\n");
         }
 
-        List<File> sources = Files.walk(sourceDir.toPath())
-                                  .map(entry -> entry.toFile())
-                                  .filter(entry -> entry.getName().endsWith(".java"))
-                                  .collect(Collectors.toList());
+        List<File> sources = sourceDirs.stream()
+                                       .flatMap(dir -> silentFilesWalk(dir))
+                                       .filter(entry -> entry.getFileName().toString().endsWith(".java"))
+                                       .map(p -> p.toFile())
+                                       .collect(Collectors.toList());
 
-        File sourceTarget = new File(targetDir, "classes");
-        sourceTarget.mkdirs();
-        String processorPath = crulesTarget.getAbsolutePath() + File.pathSeparator +
-                crulesDir.getAbsolutePath();
-        List<String> options = Arrays.asList("-d", sourceTarget.getAbsolutePath(),
+        Path sourceTarget = targetDir.resolve("classes");
+        Files.createDirectories(sourceTarget);
+        String processorPath = crulesTarget.toString() + File.pathSeparator + crulesDir.toString();
+        List<String> options = Arrays.asList("-d", sourceTarget.toString(),
                 "-processorpath", processorPath, "-Xplugin:coding_rules");
         javaCompiler.getTask(null, fm, noErrors, options, null,
                 fm.getJavaFileObjectsFromFiles(sources)).call();
     }
+
+    Stream<Path> silentFilesWalk(Path dir) throws IllegalStateException {
+        try {
+            return Files.walk(dir);
+        } catch (IOException ex) {
+            throw new IllegalStateException(ex);
+        }
+    }
 }
--- a/langtools/test/tools/javac/defaultMethods/Assertions.java	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/test/tools/javac/defaultMethods/Assertions.java	Wed Jul 05 20:00:03 2017 +0200
@@ -26,20 +26,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-/*
- * @test
- * @bug 8025141
- * @ignore 8047675 test fails if run with assertions enabled in jtreg
- * @summary Interfaces must not contain non-public fields, ensure $assertionsDisabled
- *          is not generated into an interface
- * @compile Assertions.java
- * @run main/othervm -da test.Assertions
- * @run main/othervm -ea:test.Assertions test.Assertions Inner
- * @run main/othervm -ea:test.Outer test.Assertions Outer
- * @run main/othervm -ea:test.Another test.Assertions Another.Inner
- * @run main/othervm -ea:test... test.Assertions Inner Outer Another.Inner
- */
-
 public class Assertions {
     interface Inner {
         default void testInner() {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/AssertionsTest.java	Wed Jul 05 20:00:03 2017 +0200
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013, 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8025141
+ * @summary Interfaces must not contain non-public fields, ensure $assertionsDisabled
+ *          is not generated into an interface
+ * @library /tools/lib
+ * @build ToolBox Assertions AssertionsTest
+ * @run main AssertionsTest -da
+ * @run main AssertionsTest -ea:test.Assertions Inner
+ * @run main AssertionsTest -ea:test.Outer Outer
+ * @run main AssertionsTest -ea:test.Another Another.Inner
+ * @run main AssertionsTest -ea:test... Inner Outer Another.Inner
+ */
+
+import java.util.Arrays;
+
+public class AssertionsTest {
+
+    public static void main(String... args) throws Exception {
+        String testClasses = System.getProperty("test.classes");
+        ToolBox tb = new ToolBox();
+        tb.new JavaTask().classpath(testClasses)
+                         .vmOptions(args[0])
+                         .className("test.Assertions")
+                         .classArgs(Arrays.copyOfRange(args, 1, args.length))
+                         .includeStandardOptions(false)
+                         .run(ToolBox.Expect.SUCCESS)
+                         .writeAll();
+    }
+
+}
--- a/langtools/test/tools/javac/diags/MessageInfo.java	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/test/tools/javac/diags/MessageInfo.java	Wed Jul 05 20:00:03 2017 +0200
@@ -168,7 +168,7 @@
             for (File d = testSrc; d != null; d = d.getParentFile()) {
                 if (new File(d, "TEST.ROOT").exists()) {
                     d = d.getParentFile();
-                    File f = new File(d, "src/share/classes/com/sun/tools/javac/resources/compiler.properties");
+                    File f = new File(d, "src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties");
                     if (f.exists()) {
                         msgFile = f;
                         break;
--- a/langtools/test/tools/javap/T4501661.java	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/test/tools/javap/T4501661.java	Wed Jul 05 20:00:03 2017 +0200
@@ -38,10 +38,12 @@
         File javaFile = writeTestFile();
         File classFile = compileTestFile(javaFile);
         boolean[] values = { false, true };
-        for (boolean priv: values) {
-            for (boolean prot: values) {
-                for (boolean publ: values) {
-                    test(priv, prot, publ, classFile);
+        for (boolean pack : values) {
+            for (boolean priv : values) {
+                for (boolean prot : values) {
+                    for (boolean publ : values) {
+                        test(pack, priv, prot, publ, classFile);
+                    }
                 }
             }
         }
@@ -50,8 +52,10 @@
             throw new Exception(errors + " errors found");
     }
 
-    void test(boolean priv, boolean prot, boolean publ, File classFile) {
+    void test(boolean pack, boolean priv, boolean prot, boolean publ, File classFile) {
         List<String> args = new ArrayList<String>();
+        if (pack)
+            args.add("-package");
         if (priv)
             args.add("-private");
         if (prot)
--- a/langtools/test/tools/javap/T4975569.java	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/test/tools/javap/T4975569.java	Wed Jul 05 20:00:03 2017 +0200
@@ -23,73 +23,85 @@
 
 /*
  * @test
- * @bug 4975569 6622215
+ * @bug 4975569 6622215 8034861
  * @summary javap doesn't print new flag bits
  */
 
 import java.io.*;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
-public class T4975569
-{
+public class T4975569 {
+    private static final String NEW_LINE = System.getProperty("line.separator");
+    private static final String TEST_CLASSES = System.getProperty("test.classes", ".");
+
     public static void main(String... args) {
         new T4975569().run();
     }
 
     void run() {
-        verify("T4975569$Anno", "flags: ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION");
-        verify("T4975569$E",    "flags: ACC_FINAL, ACC_SUPER, ACC_ENUM");
-        verify("T4975569$S",    "flags: ACC_BRIDGE, ACC_SYNTHETIC",
-                                "InnerClasses:\n     static");
-        verify("T4975569$V",    "void m(java.lang.String...)",
-                                "flags: ACC_VARARGS");
-        verify("T4975569$Prot", "InnerClasses:\n     protected");
-        //verify("T4975569$Priv", "InnerClasses");
+        verify(Anno.class.getName(), "flags: ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION");
+        verify(E.class.getName(),    "flags: ACC_FINAL, ACC_SUPER, ACC_ENUM");
+        verify(S.class.getName(),    "flags: ACC_BRIDGE, ACC_SYNTHETIC",
+                                     "InnerClasses:\n  static [# =\\w]+; +// ");
+        verify(V.class.getName(),    "void m\\(java.lang.String...\\)",
+                                     "flags: ACC_VARARGS");
+        verify(Prot.class.getName(), "InnerClasses:\n  protected [# =\\w]+; +// ");
+        verify(Priv.class.getName(), new String[]{"-p"},
+                                     "InnerClasses:\n  private [# =\\w]+; +// ");
+
         if (errors > 0)
             throw new Error(errors + " found.");
     }
 
-    void verify(String className, String... expects) {
-        String output = javap(className);
+    void verify(String className, String[] flags, String... expects) {
+        String output = javap(className, Arrays.asList(flags));
         for (String expect: expects) {
-            if (output.indexOf(expect)< 0)
+            Pattern expectPattern = Pattern.compile(expect);
+            Matcher matcher = expectPattern.matcher(output);
+            if (!matcher.find()) {
                 error(expect + " not found");
+            }
         }
     }
 
-    void error(String msg) {
-        System.err.println(msg);
-        errors++;
+    void verify(String className, String... expects) {
+        verify(className, new String[0], expects);
     }
 
     int errors;
+    void error(String msg) {
+        System.err.println(msg.replace("\n", NEW_LINE));
+        errors++;
+    }
 
-    String javap(String className) {
-        String newline = System.getProperty("line.separator");
-        String testClasses = System.getProperty("test.classes", ".");
+    String javap(String className, List<String> flags) {
         StringWriter sw = new StringWriter();
         PrintWriter out = new PrintWriter(sw);
-        String[] args = { "-v", "-classpath", testClasses, className };
-        int rc = com.sun.tools.javap.Main.run(args, out);
+        List<String> args = new ArrayList<>(flags);
+        args.addAll(Arrays.asList("-v", "-classpath", TEST_CLASSES, className));
+        int rc = com.sun.tools.javap.Main.run(args.toArray(new String[args.size()]), out);
+        out.close();
+        String output = sw.toString();
+        System.err.println("class " + className);
+        System.err.println(output);
+
         if (rc != 0)
             throw new Error("javap failed. rc=" + rc);
-        out.close();
-        String output = sw.toString().replaceAll(newline, "\n");
-        System.out.println("class " + className);
-        System.out.println(output);
-        return output;
+        return output.replaceAll(NEW_LINE, "\n");
     }
 
-    List x() { return null; };
+    List x() { return null; }
 
     class V { void m(String... args) { } }
-    enum E { e; }
+    enum E { e }
     @interface Anno { }
     static class S extends T4975569 {
         ArrayList x() { return null; }
     }
 
     protected class Prot { }
-    //private class Priv { int i; }
+    private class Priv { int i; }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javap/T8038414.java	Wed Jul 05 20:00:03 2017 +0200
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2014, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/*
+ * @test
+ * @bug 8038414
+ * @summary Constant pool's strings are not escaped properly
+ */
+public class T8038414 {
+    private static final String NEW_LINE = System.getProperty("line.separator");
+    private static final String TEST_CLASSES = System.getProperty("test.classes", ".");
+    private static final String GOLDEN_STRING = escapeString(Test.test);
+
+    private static String escapeString(String s) {
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+            switch (c) {
+                case '\t':
+                    sb.append('\\').append('t');
+                    break;
+                case '\n':
+                    sb.append('\\').append('n');
+                    break;
+                case '\r':
+                    sb.append('\\').append('r');
+                    break;
+                case '\b':
+                    sb.append('\\').append('b');
+                    break;
+                case '\f':
+                    sb.append('\\').append('f');
+                    break;
+                case '\"':
+                    sb.append('\\').append('\"');
+                    break;
+                case '\'':
+                    sb.append('\\').append('\'');
+                    break;
+                case '\\':
+                    sb.append('\\').append('\\');
+                    break;
+                default:
+                    sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+
+    public static void main(String... args) {
+        new T8038414().run();
+    }
+
+    public void run() {
+        String output = javap(Test.class.getName());
+        List<String> actualValues = extractEscapedComments(output);
+        for (String a : actualValues) {
+            check(!GOLDEN_STRING.equals(a), String.format("Expected: %s, got: %s", GOLDEN_STRING, a));
+        }
+    }
+
+    private List<String> extractConstantPool(String output) {
+        List<String> cp = new ArrayList<>();
+        boolean inCp = false;
+        for (String s : output.split("\n")) {
+            if (s.equals("{")) {
+                break;
+            }
+            if (inCp) {
+                cp.add(s);
+            }
+            if (s.equals("Constant pool:")) {
+                inCp = true;
+            }
+        }
+        return cp;
+    }
+
+    /**
+     * Returns a list which contains comments of the string entry in the constant pool
+     * and the appropriate UTF-8 value.
+     *
+     * @return a list
+     */
+    private List<String> extractEscapedComments(String output) {
+        List<String> result = new ArrayList<>();
+        Pattern stringPattern = Pattern.compile(" +#\\d+ = String +#(\\d+) +// +(.*)");
+        int index = -1;
+        List<String> cp = extractConstantPool(output);
+        for (String c : cp) {
+            Matcher matcher = stringPattern.matcher(c);
+            if (matcher.matches()) {
+                index = Integer.parseInt(matcher.group(1)) - 1;
+                result.add(matcher.group(2));
+                // only one String entry
+                break;
+            }
+        }
+        check(index == -1, "Escaped string is not found in constant pool");
+        result.add(cp.get(index).replaceAll(".* +", "")); // remove #16 = Utf8
+        return result;
+    }
+
+    private String javap(String className) {
+        StringWriter sw = new StringWriter();
+        PrintWriter out = new PrintWriter(sw);
+        int rc = com.sun.tools.javap.Main.run(new String[]{"-v", "-classpath", TEST_CLASSES, className}, out);
+        out.close();
+        String output = sw.toString();
+        System.err.println("class " + className);
+        System.err.println(output);
+
+        check(rc != 0, "javap failed. rc=" + rc);
+        return output.replaceAll(NEW_LINE, "\n");
+    }
+
+    private void check(boolean cond, String msg) {
+        if (cond) {
+            throw new RuntimeException(msg);
+        }
+    }
+
+    static class Test {
+        static String test = "\\t\t\b\r\n\f\"\'\\";
+    }
+}
--- a/langtools/test/tools/lib/ToolBox.java	Wed Jul 05 19:59:57 2017 +0200
+++ b/langtools/test/tools/lib/ToolBox.java	Wed Jul 05 20:00:03 2017 +0200
@@ -1568,6 +1568,20 @@
         }
 
         /**
+         * Sets whether or not the standard VM and java options for the test should be passed
+         * to the new VM instance. If this method is not called, the default behavior is that
+         * the options will be passed to the new VM instance.
+         *
+         * @param includeStandardOptions whether or not the standard VM and java options for
+         *                               the test should be passed to the new VM instance.
+         * @return this task object
+         */
+        public JavaTask includeStandardOptions(boolean includeStandardOptions) {
+            this.includeStandardOptions = includeStandardOptions;
+            return this;
+        }
+
+        /**
          * {@inheritDoc}
          * @return the name "java"
          */