mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8055079: Group 9c: golden files for tests in tools/javac dir
Reviewed-by: jjg
This commit is contained in:
parent
170f8549b4
commit
f064e2b028
18 changed files with 40 additions and 226 deletions
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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 4479164
|
* @bug 4479164
|
||||||
* @summary Throws clauses incompatible with Object methods allowed in interfaces
|
* @summary Throws clauses incompatible with Object methods allowed in interfaces
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail InterfaceObjectIncompatibility.java
|
* @compile/fail/ref=InterfaceObjectIncompatibility.out -XDrawDiagnostics InterfaceObjectIncompatibility.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interface InterfaceObjectIncompatibility {
|
interface InterfaceObjectIncompatibility {
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
InterfaceObjectIncompatibility.java:12:12: compiler.err.override.meth.doesnt.throw: (compiler.misc.cant.override: toString(), InterfaceObjectIncompatibility, toString(), java.lang.Object), java.io.IOException
|
||||||
|
InterfaceObjectIncompatibility.java:13:9: compiler.err.override.meth.doesnt.throw: (compiler.misc.cant.override: hashCode(), InterfaceObjectIncompatibility, hashCode(), java.lang.Object), java.lang.Exception
|
||||||
|
2 errors
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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 4526026
|
* @bug 4526026
|
||||||
* @summary javac allows access to interface members inherited protected from Object
|
* @summary javac allows access to interface members inherited protected from Object
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail InterfaceObjectInheritance.java
|
* @compile/fail/ref=InterfaceObjectInheritance.out -XDrawDiagnostics InterfaceObjectInheritance.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interface InterfaceObjectInheritance {
|
interface InterfaceObjectInheritance {
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
InterfaceObjectInheritance.java:17:18: compiler.err.cant.resolve.location.args: kindname.method, finalize, , , (compiler.misc.location.1: kindname.variable, i, InterfaceObjectInheritance)
|
||||||
|
1 error
|
|
@ -1,31 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* @bug 4668238 4721069
|
||||||
*
|
* @summary compiler must reject interface "overriding" final Object meth.
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* @compile/fail/ref=InterfaceOverrideFinal.out -XDrawDiagnostics InterfaceOverrideFinal.java
|
||||||
* 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 4668238 4721069
|
|
||||||
@summary compiler must reject interface "overriding" final Object meth.
|
|
||||||
@compile/fail InterfaceOverrideFinal.java
|
|
||||||
*/
|
|
||||||
public interface InterfaceOverrideFinal {
|
public interface InterfaceOverrideFinal {
|
||||||
void notify();
|
void notify();
|
||||||
}
|
}
|
||||||
|
|
2
langtools/test/tools/javac/InterfaceOverrideFinal.out
Normal file
2
langtools/test/tools/javac/InterfaceOverrideFinal.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
InterfaceOverrideFinal.java:8:10: compiler.err.override.meth: (compiler.misc.cant.override: notify(), InterfaceOverrideFinal, notify(), java.lang.Object), final
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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 4039843
|
* @bug 4039843
|
||||||
* @summary The compiler should not allow labeled declarations.
|
* @summary The compiler should not allow labeled declarations.
|
||||||
* @author turnidge
|
* @author turnidge
|
||||||
*
|
*
|
||||||
* @compile/fail LabeledDeclaration.java
|
* @compile/fail/ref=LabeledDeclaration.out -XDrawDiagnostics LabeledDeclaration.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class LabeledDeclaration {
|
class LabeledDeclaration {
|
||||||
|
|
3
langtools/test/tools/javac/LabeledDeclaration.out
Normal file
3
langtools/test/tools/javac/LabeledDeclaration.out
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
LabeledDeclaration.java:12:14: compiler.err.dot.class.expected
|
||||||
|
LabeledDeclaration.java:12:10: compiler.err.not.stmt
|
||||||
|
2 errors
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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 1241001
|
* @bug 1241001
|
||||||
* @summary The compiler failed to detect duplicate, nested labels.
|
* @summary The compiler failed to detect duplicate, nested labels.
|
||||||
* @author turnidge
|
* @author turnidge
|
||||||
*
|
*
|
||||||
* @compile/fail NestedDuplicateLabels.java
|
* @compile/fail/ref=NestedDuplicateLabels.out -XDrawDiagnostics NestedDuplicateLabels.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class NestedDuplicateLabels {
|
class NestedDuplicateLabels {
|
||||||
|
|
2
langtools/test/tools/javac/NestedDuplicateLabels.out
Normal file
2
langtools/test/tools/javac/NestedDuplicateLabels.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
NestedDuplicateLabels.java:12:14: compiler.err.label.already.in.use: foo
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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 4959929
|
* @bug 4959929
|
||||||
* @summary unclear diagnostic for "new T()"
|
* @summary unclear diagnostic for "new T()"
|
||||||
* @author never
|
* @author never
|
||||||
*
|
*
|
||||||
* @compile/fail NewGeneric.java
|
* @compile/fail/ref=NewGeneric.out -XDrawDiagnostics NewGeneric.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
2
langtools/test/tools/javac/NewGeneric.out
Normal file
2
langtools/test/tools/javac/NewGeneric.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
NewGeneric.java:13:28: compiler.err.type.found.req: (compiler.misc.type.parameter: T), (compiler.misc.type.req.class)
|
||||||
|
1 error
|
|
@ -1,35 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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 4041851
|
* @bug 4041851
|
||||||
* @summary The gramamr allows java files without class or interface
|
* @summary The gramamr allows java files without class or interface
|
||||||
* declarations; when the compiler encountered this, it failed
|
* declarations; when the compiler encountered this, it failed
|
||||||
* to check the validity of import declarations.
|
* to check the validity of import declarations.
|
||||||
* @author turnidge
|
* @author turnidge
|
||||||
*
|
*
|
||||||
* @compile/fail NoClass.java
|
* @compile/fail/ref=NoClass.out -XDrawDiagnostics NoClass.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import nonexistent.pack.cls;
|
import nonexistent.pack.cls;
|
||||||
|
|
2
langtools/test/tools/javac/NoClass.out
Normal file
2
langtools/test/tools/javac/NoClass.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
NoClass.java:12:24: compiler.err.doesnt.exist: nonexistent.pack
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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 4091755
|
* @bug 4091755
|
||||||
* @summary java.lang.Object can't be redefined without crashing javac
|
* @summary java.lang.Object can't be redefined without crashing javac
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail Object1.java
|
* @compile/fail/ref=Object1.out -XDrawDiagnostics Object1.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package java.lang;
|
package java.lang;
|
||||||
|
|
2
langtools/test/tools/javac/Object1.out
Normal file
2
langtools/test/tools/javac/Object1.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Object1.java:11:22: compiler.err.cyclic.inheritance: java.lang.Throwable
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* 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 4091755
|
* @bug 4091755
|
||||||
* @summary java.lang.Object can't be redefined without crashing javac
|
* @summary java.lang.Object can't be redefined without crashing javac
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail Object2.java
|
* @compile/fail/ref=Object2.out -XDrawDiagnostics Object2.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package java.lang;
|
package java.lang;
|
||||||
|
|
2
langtools/test/tools/javac/Object2.out
Normal file
2
langtools/test/tools/javac/Object2.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Object2.java:11:25: compiler.err.cyclic.inheritance: java.lang.Cloneable
|
||||||
|
1 error
|
Loading…
Add table
Add a link
Reference in a new issue