--- a/langtools/test/tools/javac/enum/AbstractEmptyEnum.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/AbstractEmptyEnum.java Mon Jul 07 12:44:20 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 5009601
* @summary empty enum cannot be abstract
* @author Joseph D. Darcy
*
- * @compile/fail AbstractEmptyEnum.java
+ * @compile/fail/ref=AbstractEmptyEnum.out -XDrawDiagnostics AbstractEmptyEnum.java
*/
public enum AbstractEmptyEnum {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/AbstractEmptyEnum.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,2 @@
+AbstractEmptyEnum.java:10:8: compiler.err.does.not.override.abstract: AbstractEmptyEnum, m(), AbstractEmptyEnum
+1 error
--- a/langtools/test/tools/javac/enum/Enum2.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/Enum2.java Mon Jul 07 12:44:20 2014 -0700
@@ -1,32 +1,8 @@
/*
- * 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/
* @summary enums: an enumeration type may not be extended
* @author gafter
- *
- * @compile/fail Enum2.java
+ * @compile/fail/ref=Enum2.out -XDrawDiagnostics Enum2.java
*/
public class Enum2 {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/Enum2.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,3 @@
+Enum2.java:10:29: compiler.err.cant.inherit.from.final: Enum2.e1
+Enum2.java:10:12: compiler.err.enum.types.not.extensible
+2 errors
--- a/langtools/test/tools/javac/enum/LocalEnum.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/LocalEnum.java Mon Jul 07 12:44:20 2014 -0700
@@ -1,33 +1,9 @@
/*
- * 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 5019609
* @summary javac fails to reject local enums
* @author gafter
- *
- * @compile/fail LocalEnum.java
+ * @compile/fail/ref=LocalEnum.out -XDrawDiagnostics LocalEnum.java
*/
public class LocalEnum {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/LocalEnum.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,2 @@
+LocalEnum.java:11:9: compiler.err.local.enum
+1 error
--- a/langtools/test/tools/javac/enum/NestedEnum.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/NestedEnum.java Mon Jul 07 12:44:20 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 5071831
* @summary javac allows enum in an inner class
* @author gafter
*
- * @compile/fail NestedEnum.java
+ * @compile/fail/ref=NestedEnum.out -XDrawDiagnostics NestedEnum.java
*/
class NestedEnum {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/NestedEnum.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,2 @@
+NestedEnum.java:12:9: compiler.err.enums.must.be.static
+1 error
--- a/langtools/test/tools/javac/enum/NoFinal.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/NoFinal.java Mon Jul 07 12:44:20 2014 -0700
@@ -1,32 +1,9 @@
/*
- * Copyright (c) 2004, 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 5097250 5087624
* @summary Finalize methods on enums must be compile time error
* @author Peter von der Ah\u00e9
- * @compile/fail NoFinal.java
+ * @compile/fail/ref=NoFinal.out -XDrawDiagnostics NoFinal.java
*/
enum NoFinal {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/NoFinal.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,2 @@
+NoFinal.java:11:24: compiler.err.enum.no.finalize
+1 error
--- a/langtools/test/tools/javac/enum/NoFinal2.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/NoFinal2.java Mon Jul 07 12:44:20 2014 -0700
@@ -1,32 +1,9 @@
/*
- * Copyright (c) 2004, 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 5097250 5087624
* @summary Finalize methods on enums must be compile time error
* @author Peter von der Ah\u00e9
- * @compile/fail NoFinal2.java
+ * @compile/fail/ref=NoFinal2.out -XDrawDiagnostics NoFinal2.java
*/
enum NoFinal2 {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/NoFinal2.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,2 @@
+NoFinal2.java:11:20: compiler.err.enum.no.finalize
+1 error
--- a/langtools/test/tools/javac/enum/NoFinal3.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/NoFinal3.java Mon Jul 07 12:44:20 2014 -0700
@@ -1,32 +1,9 @@
/*
- * Copyright (c) 2004, 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 5097250 5087624
* @summary Finalize methods on enums must be compile time error
* @author Peter von der Ah\u00e9
- * @compile/fail NoFinal3.java
+ * @compile/fail/ref=NoFinal3.out -XDrawDiagnostics NoFinal3.java
*/
enum NoFinal3 {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/NoFinal3.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,2 @@
+NoFinal3.java:11:17: compiler.err.enum.no.finalize
+1 error
--- a/langtools/test/tools/javac/enum/NoFinal4.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/NoFinal4.java Mon Jul 07 12:44:20 2014 -0700
@@ -1,32 +1,9 @@
/*
- * Copyright (c) 2004, 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 5097250 5087624
* @summary Finalize methods on enums must be compile time error
* @author Peter von der Ah\u00e9
- * @compile/fail NoFinal4.java
+ * @compile/fail/ref=NoFinal4.out -XDrawDiagnostics NoFinal4.java
*/
enum NoFinal4 {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/NoFinal4.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,2 @@
+NoFinal4.java:11:18: compiler.err.enum.no.finalize
+1 error
--- a/langtools/test/tools/javac/enum/NoFinal5.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/NoFinal5.java Mon Jul 07 12:44:20 2014 -0700
@@ -1,32 +1,9 @@
/*
- * Copyright (c) 2004, 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 5097250 5087624
* @summary Finalize methods on enums must be compile time error
* @author Peter von der Ah\u00e9
- * @compile/fail NoFinal5.java
+ * @compile/fail/ref=NoFinal5.out -XDrawDiagnostics NoFinal5.java
*/
enum NoFinal5 {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/NoFinal5.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,2 @@
+NoFinal5.java:11:10: compiler.err.enum.no.finalize
+1 error
--- a/langtools/test/tools/javac/enum/T5081785.java Mon Jul 07 12:36:45 2014 -0700
+++ b/langtools/test/tools/javac/enum/T5081785.java Mon Jul 07 12:44:20 2014 -0700
@@ -1,43 +1,31 @@
/*
- * 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 /nodynamiccopyright/
+ * @bug 5081785
+ * @summary Empty Enums allowed in non-static contexts
+ * @author Peter von der Ah\u00e9
+ * @compile/fail/ref=T5081785.out -XDrawDiagnostics T5081785.java
*/
-/*
- * @test
- * @bug 5081785
- *
- * @summary Empty Enums allowed in non-static contexts
- * @author Peter von der Ah\u00e9
- *
- * @compile/fail T5081785.java
- * @compile/fail T5081785a.java
- * @compile/fail T5081785b.java
- * @compile/fail T5081785c.java
- */
-
-class A {
+class A1 {
public void check() {
class Foo {
enum STRENGTH{};
};
}
}
+
+class A2 {
+ public A2 check() {
+ return new A2() { enum STRENGTH{}; };
+ }
+}
+
+class A3 {
+ Object o = new Object() { enum STRENGTH{}; };
+}
+
+class A4 {
+ class B {
+ enum C { X, Y, Z }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/enum/T5081785.out Mon Jul 07 12:44:20 2014 -0700
@@ -0,0 +1,5 @@
+T5081785.java:29:9: compiler.err.enums.must.be.static
+T5081785.java:12:13: compiler.err.enums.must.be.static
+T5081785.java:19:27: compiler.err.enums.must.be.static
+T5081785.java:24:31: compiler.err.enums.must.be.static
+4 errors