8055080: Group 9d: golden files for tests in tools/javac dir
authorsogoel
Fri, 12 Sep 2014 17:05:18 -0700
changeset 26662 7cf828d7c8fc
parent 26542 9d0e6639a4d7
child 26663 f2d8845a9bb2
8055080: Group 9d: golden files for tests in tools/javac dir Reviewed-by: jjg, mcimadamore, jlahoda
langtools/test/tools/javac/Parens1.java
langtools/test/tools/javac/Parens1.out
langtools/test/tools/javac/Parens2.java
langtools/test/tools/javac/Parens2.out
langtools/test/tools/javac/Parens3.java
langtools/test/tools/javac/Parens3.out
langtools/test/tools/javac/Parens4.java
langtools/test/tools/javac/Parens4.out
langtools/test/tools/javac/ParseConditional.java
langtools/test/tools/javac/ParseConditional.out
langtools/test/tools/javac/StoreClass.java
langtools/test/tools/javac/StoreClass.out
langtools/test/tools/javac/SwitchScope.java
langtools/test/tools/javac/SwitchScope.out
langtools/test/tools/javac/SynthName2.java
langtools/test/tools/javac/SynthName2.out
langtools/test/tools/javac/T6234077.java
langtools/test/tools/javac/T6234077.out
--- a/langtools/test/tools/javac/Parens1.java	Wed Jul 05 20:01:04 2017 +0200
+++ b/langtools/test/tools/javac/Parens1.java	Fri Sep 12 17:05:18 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2001, 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 4391330
  * @summary compiler accepted (Integer).toString(123)
  * @author gafter
  *
- * @compile/fail Parens1.java
+ * @compile/fail/ref=Parens1.out -XDrawDiagnostics Parens1.java
  */
 
 class Parens1 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Parens1.out	Fri Sep 12 17:05:18 2014 -0700
@@ -0,0 +1,2 @@
+Parens1.java:12:20: compiler.err.illegal.start.of.type
+1 error
--- a/langtools/test/tools/javac/Parens2.java	Wed Jul 05 20:01:04 2017 +0200
+++ b/langtools/test/tools/javac/Parens2.java	Fri Sep 12 17:05:18 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2001, 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 4408036
  * @summary Compiler accepted "(i=2);" as a valid expession statement.
  * @author gafter
  *
- * @compile/fail Parens2.java
+ * @compile/fail/ref=Parens2.out -XDrawDiagnostics Parens2.java
  */
 
 class Parens2 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Parens2.out	Fri Sep 12 17:05:18 2014 -0700
@@ -0,0 +1,2 @@
+Parens2.java:13:9: compiler.err.not.stmt
+1 error
--- a/langtools/test/tools/javac/Parens3.java	Wed Jul 05 20:01:04 2017 +0200
+++ b/langtools/test/tools/javac/Parens3.java	Fri Sep 12 17:05:18 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2001, 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 4394546
  * @summary get no err msg if label wrapped in parentheses
  * @author gafter
  *
- * @compile/fail Parens3.java
+ * @compile/fail/ref=Parens3.out -XDrawDiagnostics Parens3.java
  */
 
 class Parens3 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Parens3.out	Fri Sep 12 17:05:18 2014 -0700
@@ -0,0 +1,3 @@
+Parens3.java:12:5: compiler.err.not.stmt
+Parens3.java:12:10: compiler.err.expected: ';'
+2 errors
--- a/langtools/test/tools/javac/Parens4.java	Wed Jul 05 20:01:04 2017 +0200
+++ b/langtools/test/tools/javac/Parens4.java	Fri Sep 12 17:05:18 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 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 4933317
  * @summary javac accepts parens in package names
  * @author gafter
  *
- * @compile/fail Parens4.java
+ * @compile/fail/ref=Parens4.out -XDrawDiagnostics Parens4.java
  */
 
 class Parens4 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Parens4.out	Fri Sep 12 17:05:18 2014 -0700
@@ -0,0 +1,2 @@
+Parens4.java:12:16: compiler.err.illegal.start.of.type
+1 error
--- a/langtools/test/tools/javac/ParseConditional.java	Wed Jul 05 20:01:04 2017 +0200
+++ b/langtools/test/tools/javac/ParseConditional.java	Fri Sep 12 17:05:18 2014 -0700
@@ -1,34 +1,11 @@
 /*
- * Copyright (c) 1997, 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 4092958
  * @summary The compiler was too permissive in its parsing of conditional
  *          expressions.
  * @author turnidge
  *
- * @compile/fail ParseConditional.java
+ * @compile/fail/ref=ParseConditional.out -XDrawDiagnostics ParseConditional.java
  */
 
 public class ParseConditional {
@@ -38,6 +15,11 @@
         int b = 2;
         int c = 3;
         int d = 4;
-        a = condition ? b = c : c = d; // Should get a parse error.
+        // The following line should give an error because the conditional ?: operator
+        // is higher priority than the final assignment operator, between c and d.
+        // As such, the correct parsing is:
+        //   a = (condition ? b = c : c) = d;
+        // and it is illegal to try and assign to the value of the conditional expression.
+        a = condition ? b = c : c = d;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/ParseConditional.out	Fri Sep 12 17:05:18 2014 -0700
@@ -0,0 +1,2 @@
+ParseConditional.java:23:23: compiler.err.unexpected.type: kindname.variable, kindname.value
+1 error
--- a/langtools/test/tools/javac/StoreClass.java	Wed Jul 05 20:01:04 2017 +0200
+++ b/langtools/test/tools/javac/StoreClass.java	Fri Sep 12 17:05:18 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2001, 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 4350352
  * @summary InternalError: store unsupported: com.sun.tools.javac.v8.comp.Items
  * @author gafter
  *
- * @compile/fail StoreClass.java
+ * @compile/fail/ref=StoreClass.out -XDrawDiagnostics StoreClass.java
  */
 
 class StoreClass {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/StoreClass.out	Fri Sep 12 17:05:18 2014 -0700
@@ -0,0 +1,3 @@
+StoreClass.java:12:19: compiler.err.cant.assign.val.to.final.var: class
+StoreClass.java:13:12: compiler.err.cant.assign.val.to.final.var: class
+2 errors
--- a/langtools/test/tools/javac/SwitchScope.java	Wed Jul 05 20:01:04 2017 +0200
+++ b/langtools/test/tools/javac/SwitchScope.java	Fri Sep 12 17:05:18 2014 -0700
@@ -1,33 +1,10 @@
 /*
- * Copyright (c) 2002, 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 4725650
  * @summary Restrict scope of local classes in switch-block-group
  * @author gafter
  *
- * @compile/fail SwitchScope.java
+ * @compile/fail/ref=SwitchScope.out -XDrawDiagnostics SwitchScope.java
  */
 
 public class SwitchScope {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/SwitchScope.out	Fri Sep 12 17:05:18 2014 -0700
@@ -0,0 +1,2 @@
+SwitchScope.java:22:28: compiler.err.cant.resolve.location: kindname.class, Local, , , (compiler.misc.location: kindname.class, SwitchScope, null)
+1 error
--- a/langtools/test/tools/javac/SynthName2.java	Wed Jul 05 20:01:04 2017 +0200
+++ b/langtools/test/tools/javac/SynthName2.java	Fri Sep 12 17:05:18 2014 -0700
@@ -1,38 +1,15 @@
 /*
- * Copyright (c) 2001, 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 4462714
  * @summary using of synthetic names in local class causes ClassFormatError
  * @author gafter
  *
- * @compile/fail SynthName2.java
+ * @compile/fail/ref=SynthName2.out -XDrawDiagnostics SynthName2.java
  */
 
 import java.io.PrintStream;
 
-class SynthName1 {
+class SynthName2 {
     public static void main(String args[]) {
         run(args, System.out);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/SynthName2.out	Fri Sep 12 17:05:18 2014 -0700
@@ -0,0 +1,4 @@
+SynthName2.java:33:9: compiler.err.synthetic.name.conflict: val$zzz, InnClass
+SynthName2.java:34:17: compiler.err.synthetic.name.conflict: val$prm1, InnClass
+SynthName2.java:35:17: compiler.err.synthetic.name.conflict: val$zzz, InnClass
+3 errors
--- a/langtools/test/tools/javac/T6234077.java	Wed Jul 05 20:01:04 2017 +0200
+++ b/langtools/test/tools/javac/T6234077.java	Fri Sep 12 17:05:18 2014 -0700
@@ -1,30 +1,7 @@
 /*
- * Copyright (c) 2005, 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 /nodynamiccopyright/
+ * @bug 6234077
+ * @compile/fail/ref=T6234077.out -XDrawDiagnostics T6234077.java
  */
 
-/*
- * @test
- * @bug 6234077
- * @compile/fail T6234077.java
- */
-@Deprecated /** @deprecated */
 public class Foo { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6234077.out	Fri Sep 12 17:05:18 2014 -0700
@@ -0,0 +1,2 @@
+T6234077.java:7:8: compiler.err.class.public.should.be.in.file: Foo
+1 error