8058373: Group 10a: golden files for tests in tools/javac dir

Reviewed-by: jjg, darcy
diff --git a/langtools/test/tools/javac/SerialWarn.java b/langtools/test/tools/javac/SerialWarn.java
index dce066e..431f6ae 100644
--- a/langtools/test/tools/javac/SerialWarn.java
+++ b/langtools/test/tools/javac/SerialWarn.java
@@ -1,34 +1,11 @@
 /*
- * Copyright (c) 2003, 2004, 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
+ * @test /nodynamiccopyright/
  * @bug 4854628
  * @summary include Throwable subclasses in missing serialVersionUID warning
  * @author gafter
  *
  * @compile                    -Werror SerialWarn.java
- * @compile/fail -Xlint:serial -Werror SerialWarn.java
+ * @compile/fail/ref=SerialWarn.out -XDrawDiagnostics -Xlint:serial -Werror SerialWarn.java
  */
 
 class SerialWarn extends Throwable {}
diff --git a/langtools/test/tools/javac/SerialWarn.out b/langtools/test/tools/javac/SerialWarn.out
new file mode 100644
index 0000000..23bf737
--- /dev/null
+++ b/langtools/test/tools/javac/SerialWarn.out
@@ -0,0 +1,4 @@
+SerialWarn.java:11:1: compiler.warn.missing.SVUID: SerialWarn
+- compiler.err.warnings.and.werror
+1 error
+1 warning
diff --git a/langtools/test/tools/javac/T4994049/DeprecatedYES.java b/langtools/test/tools/javac/T4994049/DeprecatedYES.java
index 4de5212..ec59558 100644
--- a/langtools/test/tools/javac/T4994049/DeprecatedYES.java
+++ b/langtools/test/tools/javac/T4994049/DeprecatedYES.java
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2005, 2006, 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
+ * @test    /nodynamiccopyright/
  * @bug     6229758
  * @summary deprecatedNOT! is
  * @author  Peter von der Ah\u00e9
  * @compile -Xlint:deprecation DeprecatedYES.java
- * @compile/fail -Werror -Xlint:deprecation DeprecatedYES.java
+ * @compile/fail/ref=DeprecatedYES.out -XDrawDiagnostics -Werror -Xlint:deprecation DeprecatedYES.java
  */
 
 class A {
diff --git a/langtools/test/tools/javac/T4994049/DeprecatedYES.out b/langtools/test/tools/javac/T4994049/DeprecatedYES.out
new file mode 100644
index 0000000..0750441
--- /dev/null
+++ b/langtools/test/tools/javac/T4994049/DeprecatedYES.out
@@ -0,0 +1,4 @@
+DeprecatedYES.java:18:10: compiler.warn.has.been.deprecated: foo(), A
+- compiler.err.warnings.and.werror
+1 error
+1 warning
diff --git a/langtools/test/tools/javac/T6231847.java b/langtools/test/tools/javac/T6231847.java
index 25b9ded..8d4ef41 100644
--- a/langtools/test/tools/javac/T6231847.java
+++ b/langtools/test/tools/javac/T6231847.java
@@ -1,9 +1,8 @@
 /*
- * @test  /nodynamiccopyright/
+ * @test    /nodynamiccopyright/
  * @bug     6231847
  * @summary Crash in com.sun.tools.javac.comp.Attr.visitNewClass:1352
  * @author  Peter von der Ah\u00e9
- * @compile/fail -XDdev T6231847.java
  * @compile/fail/ref=T6231847.out -XDdev -XDrawDiagnostics T6231847.java
  */
 
diff --git a/langtools/test/tools/javac/T6231847.out b/langtools/test/tools/javac/T6231847.out
index 6dfc875..d2f36a9 100644
--- a/langtools/test/tools/javac/T6231847.out
+++ b/langtools/test/tools/javac/T6231847.out
@@ -1,9 +1,9 @@
-T6231847.java:15:21: compiler.err.anon.class.impl.intf.no.typeargs
-T6231847.java:16:30: compiler.err.anon.class.impl.intf.no.args
+T6231847.java:14:21: compiler.err.anon.class.impl.intf.no.typeargs
+T6231847.java:15:30: compiler.err.anon.class.impl.intf.no.args
+T6231847.java:16:16: compiler.err.anon.class.impl.intf.no.qual.for.new
 T6231847.java:17:16: compiler.err.anon.class.impl.intf.no.qual.for.new
-T6231847.java:18:16: compiler.err.anon.class.impl.intf.no.qual.for.new
-T6231847.java:18:41: compiler.err.anon.class.impl.intf.no.args
-T6231847.java:18:23: compiler.err.anon.class.impl.intf.no.typeargs
-T6231847.java:19:16: compiler.err.qualified.new.of.static.class: T6231847.T6231847C
-T6231847.java:19:34: compiler.err.illegal.qual.not.icls: T6231847.T6231847C
+T6231847.java:17:41: compiler.err.anon.class.impl.intf.no.args
+T6231847.java:17:23: compiler.err.anon.class.impl.intf.no.typeargs
+T6231847.java:18:16: compiler.err.qualified.new.of.static.class: T6231847.T6231847C
+T6231847.java:18:34: compiler.err.illegal.qual.not.icls: T6231847.T6231847C
 8 errors
diff --git a/langtools/test/tools/javac/overrridecrash/B.java b/langtools/test/tools/javac/overrridecrash/B.java
index 468a32c..321d4e4 100644
--- a/langtools/test/tools/javac/overrridecrash/B.java
+++ b/langtools/test/tools/javac/overrridecrash/B.java
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2003, 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
+ * @test /nodynamiccopyright/
  * @bug 4909690
  * @summary AssertionError(com.sun.tools.javac.v8.code.Symbol$MethodSymbol.isOverridableIn)
  * @author gafter
  *
- * @compile/fail B.java
+ * @compile/fail/ref=B.out -XDrawDiagnostics B.java
  */
 
 public class B extends A
diff --git a/langtools/test/tools/javac/overrridecrash/B.out b/langtools/test/tools/javac/overrridecrash/B.out
new file mode 100644
index 0000000..cfe1aa1
--- /dev/null
+++ b/langtools/test/tools/javac/overrridecrash/B.out
@@ -0,0 +1,3 @@
+B.java:12:27: compiler.err.illegal.combination.of.modifiers: private, protected
+A.java:25:27: compiler.err.illegal.combination.of.modifiers: private, protected
+2 errors
diff --git a/langtools/test/tools/javac/processing/6365040/T6365040.java b/langtools/test/tools/javac/processing/6365040/T6365040.java
index 1155841..5619479 100644
--- a/langtools/test/tools/javac/processing/6365040/T6365040.java
+++ b/langtools/test/tools/javac/processing/6365040/T6365040.java
@@ -1,28 +1,5 @@
 /*
- * Copyright (c) 2006, 2010, 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
+ * @test /nodynamiccopyright/
  * @bug 6365040 6358129
  * @summary Test -processor foo,bar,baz
  * @author  Joseph D. Darcy
@@ -34,8 +11,8 @@
  * @compile      -processor ProcFoo,ProcBar,T6365040  -proc:only T6365040.java
  * @compile      -processor T6365040                  -proc:only T6365040.java
  * @compile      -processor T6365040,NotThere,        -proc:only T6365040.java
- * @compile/fail -processor NotThere                  -proc:only T6365040.java
- * @compile/fail -processor NotThere,T6365040         -proc:only T6365040.java
+ * @compile/fail/ref=T6365040.out -XDrawDiagnostics -processor NotThere -proc:only T6365040.java
+ * @compile/fail/ref=T6365040.out -XDrawDiagnostics -processor NotThere,T6365040 -proc:only T6365040.java
  */
 
 import java.util.Set;
diff --git a/langtools/test/tools/javac/processing/6365040/T6365040.out b/langtools/test/tools/javac/processing/6365040/T6365040.out
new file mode 100644
index 0000000..3b01100
--- /dev/null
+++ b/langtools/test/tools/javac/processing/6365040/T6365040.out
@@ -0,0 +1,4 @@
+- compiler.err.proc.processor.not.found: NotThere
+- compiler.warn.proc.proc-only.requested.no.procs
+1 error
+1 warning
diff --git a/langtools/test/tools/javac/processing/6511613/clss41701.java b/langtools/test/tools/javac/processing/6511613/clss41701.java
index 0af3e06..8ba180d 100644
--- a/langtools/test/tools/javac/processing/6511613/clss41701.java
+++ b/langtools/test/tools/javac/processing/6511613/clss41701.java
@@ -1,35 +1,11 @@
 /*
- * Copyright (c) 2010, 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
+ * @test /nodynamiccopyright/
  * @bug 6511613
  * @summary javac unexpectedly doesn't fail in some cases if an annotation processor specified
- *
  * @library /tools/javac/lib
  * @build JavacTestingAbstractProcessor DummyProcessor
- * @compile/fail clss41701.java
- * @compile/fail -processor DummyProcessor clss41701.java
+ * @compile/fail/ref=clss41701.out -XDrawDiagnostics clss41701.java
+ * @compile/fail/ref=clss41701.out -XDrawDiagnostics -processor DummyProcessor clss41701.java
  */
 
 import java.io.PrintStream;
diff --git a/langtools/test/tools/javac/processing/6511613/clss41701.out b/langtools/test/tools/javac/processing/6511613/clss41701.out
new file mode 100644
index 0000000..c8fe866
--- /dev/null
+++ b/langtools/test/tools/javac/processing/6511613/clss41701.out
@@ -0,0 +1,2 @@
+clss41701.java:19:30: compiler.err.type.var.may.not.be.followed.by.other.bounds
+1 error
diff --git a/langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.java b/langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.java
index 734844e..6058290 100644
--- a/langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.java
+++ b/langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.java
@@ -1,28 +1,5 @@
 /*
- * Copyright (c) 2006, 2010, 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
+ * @test /nodynamiccopyright/
  * @bug 6403459
  * @summary Test that generating programs with syntax errors is a fatal condition
  * @author  Joseph D. Darcy
@@ -30,7 +7,7 @@
  * @build JavacTestingAbstractProcessor
  * @compile TestReturnCode.java
  * @compile TestFatalityOfParseErrors.java
- * @compile/fail -XprintRounds -processor TestFatalityOfParseErrors -proc:only TestFatalityOfParseErrors.java
+ * @compile/fail/ref=TestFatalityOfParseErrors.out -XDrawDiagnostics -XprintRounds -processor TestFatalityOfParseErrors -proc:only TestFatalityOfParseErrors.java
  */
 
 import java.util.Set;
@@ -49,41 +26,12 @@
  * is marked as an error.
  */
 public class TestFatalityOfParseErrors extends JavacTestingAbstractProcessor {
-    int round = 0;
 
     public boolean process(Set<? extends TypeElement> annotations,
                            RoundEnvironment roundEnvironment) {
-        try {
-            PrintWriter pw = null;
-            round++;
-
-            switch (round) {
-            case 1:
-                pw = new PrintWriter(filer.createSourceFile("SyntaxError").openWriter());
-                pw.println("class SyntaxError {");
-                pw.close();
-                break;
-
-            case 2:
-                pw = new PrintWriter(filer.createSourceFile("SimpleClass").openWriter());
-                pw.println("class SimpleClass {}");
-                pw.close();
-
-                if (!roundEnvironment.errorRaised() || !roundEnvironment.processingOver() ) {
-                    System.err.println(roundEnvironment);
-                    throw new RuntimeException("Second round not erroneous as expected.");
-                }
-                if (!roundEnvironment.getRootElements().isEmpty()) {
-                    System.err.println(roundEnvironment);
-                    throw new RuntimeException("Root elements not empty as expected.");
-                }
-                break;
-
-            default:
-                throw new RuntimeException("Unexpected round number " + round);
-            }
+        try (PrintWriter pw = new PrintWriter(filer.createSourceFile("SyntaxError").openWriter())) {
+            pw.println("class SyntaxError {");
         } catch (IOException ioException) {
-            throw new RuntimeException(ioException);
         }
         return true;
     }
diff --git a/langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.out b/langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.out
new file mode 100644
index 0000000..23be981
--- /dev/null
+++ b/langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.out
@@ -0,0 +1,10 @@
+Round 1:
+	input files: {TestFatalityOfParseErrors}
+	annotations: []
+	last round: false
+Round 2:
+	input files: {}
+	annotations: []
+	last round: true
+SyntaxError.java:1:20: compiler.err.premature.eof
+1 error
diff --git a/langtools/test/tools/javac/processing/messager/MessagerBasics.java b/langtools/test/tools/javac/processing/messager/MessagerBasics.java
index 66a16c3..f6c275d 100644
--- a/langtools/test/tools/javac/processing/messager/MessagerBasics.java
+++ b/langtools/test/tools/javac/processing/messager/MessagerBasics.java
@@ -1,28 +1,5 @@
 /*
- * Copyright (c) 2005, 2010, 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
+ * @test    /nodynamiccopyright/
  * @bug     6341173 6341072
  * @summary Test presence of Messager methods
  * @author  Joseph D. Darcy
@@ -30,9 +7,9 @@
  * @build   JavacTestingAbstractProcessor
  * @compile MessagerBasics.java
  * @compile -processor MessagerBasics -proc:only MessagerBasics.java
- * @compile/fail -processor MessagerBasics -proc:only -AfinalError MessagerBasics.java
+ * @compile/fail/ref=MessagerBasics.out -XDrawDiagnostics -processor MessagerBasics -proc:only -AfinalError MessagerBasics.java
  * @compile -processor MessagerBasics MessagerBasics.java
- * @compile/fail -processor MessagerBasics -AfinalError MessagerBasics.java
+ * @compile/fail/ref=MessagerBasics.out -XDrawDiagnostics -processor MessagerBasics -AfinalError MessagerBasics.java
  */
 
 import java.util.Set;
diff --git a/langtools/test/tools/javac/processing/messager/MessagerBasics.out b/langtools/test/tools/javac/processing/messager/MessagerBasics.out
new file mode 100644
index 0000000..271e6c9
--- /dev/null
+++ b/langtools/test/tools/javac/processing/messager/MessagerBasics.out
@@ -0,0 +1,2 @@
+- compiler.err.proc.messager: Does not compute
+1 error
diff --git a/langtools/test/tools/javac/staticQualifiedNew/StaticQualifiedNew.java b/langtools/test/tools/javac/staticQualifiedNew/StaticQualifiedNew.java
index fcd9f21..410a55d 100644
--- a/langtools/test/tools/javac/staticQualifiedNew/StaticQualifiedNew.java
+++ b/langtools/test/tools/javac/staticQualifiedNew/StaticQualifiedNew.java
@@ -1,33 +1,9 @@
 /*
- * Copyright (c) 2000, 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
+ * @test /nodynamiccopyright/
  * @bug 4295650
  * @summary Verify that qualified 'new' of static class is forbidden.
  * @author maddox (after gbracha)
- *
- * @compile/fail StaticQualifiedNew.java
+ * @compile/fail/ref=StaticQualifiedNew.out -XDrawDiagnostics StaticQualifiedNew.java
  */
 
 import p2.X;
diff --git a/langtools/test/tools/javac/staticQualifiedNew/StaticQualifiedNew.out b/langtools/test/tools/javac/staticQualifiedNew/StaticQualifiedNew.out
new file mode 100644
index 0000000..a627d54
--- /dev/null
+++ b/langtools/test/tools/javac/staticQualifiedNew/StaticQualifiedNew.out
@@ -0,0 +1,2 @@
+StaticQualifiedNew.java:13:11: compiler.err.qualified.new.of.static.class: p2.X.M
+1 error