8046635: .out files for enum tests in tools/javac/dir
Reviewed-by: jjg
This commit is contained in:
parent
72d5723212
commit
0718a280b0
@ -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 5009574
|
||||
* @summary verify java.lang.Enum can't be directly subclassed
|
||||
* @author Joseph D. Darcy
|
||||
*
|
||||
* @compile/fail FauxEnum1.java
|
||||
* @compile/fail/ref=FauxEnum1.out -XDrawDiagnostics FauxEnum1.java
|
||||
*/
|
||||
|
||||
public class FauxEnum1 extends java.lang.Enum {
|
||||
|
2
langtools/test/tools/javac/enum/FauxEnum1.out
Normal file
2
langtools/test/tools/javac/enum/FauxEnum1.out
Normal file
@ -0,0 +1,2 @@
|
||||
FauxEnum1.java:10:8: compiler.err.enum.no.subclassing
|
||||
1 error
|
@ -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 5009574
|
||||
* @summary verify an enum type can't be directly subclassed
|
||||
* @author Joseph D. Darcy
|
||||
*
|
||||
* @compile/fail FauxEnum3.java
|
||||
* @compile/fail/ref=FauxEnum3.out -XDrawDiagnostics FauxEnum3.java
|
||||
*/
|
||||
|
||||
public class FauxEnum3 extends SpecializedEnum {
|
||||
|
2
langtools/test/tools/javac/enum/FauxEnum3.out
Normal file
2
langtools/test/tools/javac/enum/FauxEnum3.out
Normal file
@ -0,0 +1,2 @@
|
||||
FauxEnum3.java:10:8: compiler.err.enum.types.not.extensible
|
||||
1 error
|
@ -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 verify specialized enum classes can't be abstract
|
||||
* @author Joseph D. Darcy
|
||||
*
|
||||
* @compile/fail FauxSpecialEnum1.java
|
||||
* @compile/fail/ref=FauxSpecialEnum1.out -XDrawDiagnostics FauxSpecialEnum1.java
|
||||
*/
|
||||
|
||||
public enum FauxSpecialEnum1 {
|
||||
|
2
langtools/test/tools/javac/enum/FauxSpecialEnum1.out
Normal file
2
langtools/test/tools/javac/enum/FauxSpecialEnum1.out
Normal file
@ -0,0 +1,2 @@
|
||||
FauxSpecialEnum1.java:14:5: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: FauxSpecialEnum1$2, test(), compiler.misc.anonymous.class: FauxSpecialEnum1$2
|
||||
1 error
|
@ -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 verify specialized enum classes can't be abstract
|
||||
* @author Joseph D. Darcy
|
||||
*
|
||||
* @compile/fail FauxSpecialEnum2.java
|
||||
* @compile/fail/ref=FauxSpecialEnum2.out -XDrawDiagnostics FauxSpecialEnum2.java
|
||||
*/
|
||||
|
||||
public enum FauxSpecialEnum2 {
|
||||
|
2
langtools/test/tools/javac/enum/FauxSpecialEnum2.out
Normal file
2
langtools/test/tools/javac/enum/FauxSpecialEnum2.out
Normal file
@ -0,0 +1,2 @@
|
||||
FauxSpecialEnum2.java:12:5: compiler.err.does.not.override.abstract: compiler.misc.anonymous.class: FauxSpecialEnum2$1, test(), compiler.misc.anonymous.class: FauxSpecialEnum2$1
|
||||
1 error
|
@ -1,32 +1,9 @@
|
||||
/*
|
||||
* 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 6209839
|
||||
* @summary Illegal forward reference to enum constants allowed by javac
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail TestEnum1.java
|
||||
* @compile/fail/ref=TestEnum1.out -XDrawDiagnostics TestEnum1.java
|
||||
*/
|
||||
|
||||
enum TestEnum {
|
||||
|
3
langtools/test/tools/javac/enum/forwardRef/TestEnum1.out
Normal file
3
langtools/test/tools/javac/enum/forwardRef/TestEnum1.out
Normal file
@ -0,0 +1,3 @@
|
||||
TestEnum1.java:11:39: compiler.err.illegal.enum.static.ref
|
||||
TestEnum1.java:12:40: compiler.err.illegal.enum.static.ref
|
||||
2 errors
|
@ -1,32 +1,9 @@
|
||||
/*
|
||||
* 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 6209839
|
||||
* @summary Illegal forward reference to enum constants allowed by javac
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail TestEnum2.java
|
||||
* @compile/fail/ref=TestEnum2.out -XDrawDiagnostics TestEnum2.java
|
||||
*/
|
||||
|
||||
enum TestEnum {
|
||||
|
3
langtools/test/tools/javac/enum/forwardRef/TestEnum2.out
Normal file
3
langtools/test/tools/javac/enum/forwardRef/TestEnum2.out
Normal file
@ -0,0 +1,3 @@
|
||||
TestEnum2.java:13:36: compiler.err.illegal.enum.static.ref
|
||||
TestEnum2.java:14:36: compiler.err.illegal.enum.static.ref
|
||||
2 errors
|
@ -1,32 +1,9 @@
|
||||
/*
|
||||
* 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 6209839
|
||||
* @summary Illegal forward reference to enum constants allowed by javac
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail TestEnum3.java
|
||||
* @compile/fail/ref=TestEnum3.out -XDrawDiagnostics TestEnum3.java
|
||||
*/
|
||||
|
||||
enum TestEnum {
|
||||
|
2
langtools/test/tools/javac/enum/forwardRef/TestEnum3.out
Normal file
2
langtools/test/tools/javac/enum/forwardRef/TestEnum3.out
Normal file
@ -0,0 +1,2 @@
|
||||
TestEnum3.java:13:34: compiler.err.illegal.enum.static.ref
|
||||
1 error
|
@ -1,32 +1,9 @@
|
||||
/*
|
||||
* 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 6209839
|
||||
* @summary Illegal forward reference to enum constants allowed by javac
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail TestEnum4.java
|
||||
* @compile/fail/ref=TestEnum4.out -XDrawDiagnostics TestEnum4.java
|
||||
*/
|
||||
|
||||
enum TestEnum {
|
||||
|
2
langtools/test/tools/javac/enum/forwardRef/TestEnum4.out
Normal file
2
langtools/test/tools/javac/enum/forwardRef/TestEnum4.out
Normal file
@ -0,0 +1,2 @@
|
||||
TestEnum4.java:14:24: compiler.err.illegal.enum.static.ref
|
||||
1 error
|
@ -1,32 +1,9 @@
|
||||
/*
|
||||
* 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 6209839
|
||||
* @summary Illegal forward reference to enum constants allowed by javac
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail TestEnum5.java
|
||||
* @compile/fail/ref=TestEnum5.out -XDrawDiagnostics TestEnum5.java
|
||||
*/
|
||||
|
||||
enum TestEnum {
|
||||
|
2
langtools/test/tools/javac/enum/forwardRef/TestEnum5.out
Normal file
2
langtools/test/tools/javac/enum/forwardRef/TestEnum5.out
Normal file
@ -0,0 +1,2 @@
|
||||
TestEnum5.java:15:20: compiler.err.illegal.enum.static.ref
|
||||
1 error
|
@ -1,32 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 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 6424491
|
||||
* @summary Cannot initialise nested enums
|
||||
* @author Peter von der Ah\u00e9
|
||||
* @compile/fail TestEnum6.java
|
||||
* @compile/fail/ref=TestEnum6.out -XDrawDiagnostics TestEnum6.java
|
||||
*/
|
||||
|
||||
public enum TestEnum6 {
|
||||
|
2
langtools/test/tools/javac/enum/forwardRef/TestEnum6.out
Normal file
2
langtools/test/tools/javac/enum/forwardRef/TestEnum6.out
Normal file
@ -0,0 +1,2 @@
|
||||
TestEnum6.java:10:18: compiler.err.illegal.self.ref
|
||||
1 error
|
Loading…
Reference in New Issue
Block a user