mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8055075: Group 9b: golden files for tests in tools/javac dir
Reviewed-by: jjg
This commit is contained in:
parent
15420bd193
commit
170f8549b4
18 changed files with 43 additions and 226 deletions
|
@ -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 4974927
|
||||
* @summary The compiler was allowing void types in its parsing of conditional expressions.
|
||||
* @author tball
|
||||
*
|
||||
* @compile/fail ConditionalWithVoid.java
|
||||
* @compile/fail/ref=ConditionalWithVoid.out -XDrawDiagnostics ConditionalWithVoid.java
|
||||
*/
|
||||
public class ConditionalWithVoid {
|
||||
public int test(Object o) {
|
||||
|
|
2
langtools/test/tools/javac/ConditionalWithVoid.out
Normal file
2
langtools/test/tools/javac/ConditionalWithVoid.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
ConditionalWithVoid.java:12:48: compiler.err.neither.conditional.subtype: java.lang.Integer, void
|
||||
1 error
|
|
@ -1,33 +1,10 @@
|
|||
/*
|
||||
* Copyright (c) 2001, 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 4531500
|
||||
* @summary Cascade of problems from duplicate class can cause compiler crash.
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail DuplicateClass.java
|
||||
* @compile/fail/ref=DuplicateClass.out -XDrawDiagnostics DuplicateClass.java
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -36,7 +13,7 @@
|
|||
* processing it.
|
||||
*/
|
||||
public class DuplicateClass {
|
||||
protected void clone() {
|
||||
protected Object clone() {
|
||||
super.clone();
|
||||
}
|
||||
}
|
||||
|
|
2
langtools/test/tools/javac/DuplicateClass.out
Normal file
2
langtools/test/tools/javac/DuplicateClass.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
DuplicateClass.java:21:8: compiler.err.duplicate.class: DuplicateClass
|
||||
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 5016879
|
||||
* @summary REGRESSION: translation unit ending in identifier crashes javac
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail EOI.java
|
||||
* @compile/fail/ref=EOI.out -XDrawDiagnostics EOI.java
|
||||
*/
|
||||
|
||||
class foobar {}
|
||||
|
|
2
langtools/test/tools/javac/EOI.out
Normal file
2
langtools/test/tools/javac/EOI.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
EOI.java:11:1: compiler.err.premature.eof
|
||||
1 error
|
|
@ -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 4630634
|
||||
* @summary missing warn about exception not thrown in try block if finally can't complete
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail ExceptionalFinally2.java
|
||||
* @compile/fail/ref=ExceptionalFinally2.out -XDrawDiagnostics ExceptionalFinally2.java
|
||||
*/
|
||||
|
||||
class ExceptionalFinally2 {
|
||||
|
|
2
langtools/test/tools/javac/ExceptionalFinally2.out
Normal file
2
langtools/test/tools/javac/ExceptionalFinally2.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
ExceptionalFinally2.java:22:11: compiler.err.except.never.thrown.in.try: ExceptionalFinally2.E
|
||||
1 error
|
|
@ -1,33 +1,10 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 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 4347611 4440249 4508227
|
||||
* @summary Check that qualified reference to type via an expression does not crash compiler.
|
||||
* @author maddox
|
||||
*
|
||||
* @compile/fail ExprQualifiedType.java
|
||||
* @compile/fail/ref=ExprQualifiedType.out -XDrawDiagnostics ExprQualifiedType.java
|
||||
*/
|
||||
|
||||
public class ExprQualifiedType {
|
||||
|
|
3
langtools/test/tools/javac/ExprQualifiedType.out
Normal file
3
langtools/test/tools/javac/ExprQualifiedType.out
Normal file
|
@ -0,0 +1,3 @@
|
|||
ExprQualifiedType.java:18:9: compiler.err.unexpected.type: kindname.class,kindname.package, kindname.value
|
||||
ExprQualifiedType.java:19:9: compiler.err.unexpected.type: kindname.class,kindname.package, kindname.value
|
||||
2 errors
|
|
@ -1,34 +1,11 @@
|
|||
/*
|
||||
* 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 4402884
|
||||
* @summary javac improperly extends superclass's scope to implements clause
|
||||
* @author gafter
|
||||
*
|
||||
* @clean I
|
||||
* @compile/fail ExtendsScope.java
|
||||
* @compile/fail/ref=ExtendsScope.out -XDrawDiagnostics ExtendsScope.java
|
||||
*/
|
||||
|
||||
class P {
|
||||
|
|
2
langtools/test/tools/javac/ExtendsScope.out
Normal file
2
langtools/test/tools/javac/ExtendsScope.out
Normal file
|
@ -0,0 +1,2 @@
|
|||
ExtendsScope.java:15:30: compiler.err.cant.resolve: kindname.class, I, ,
|
||||
1 error
|
|
@ -1,32 +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 5019614
|
||||
* @summary variance prototype syntax leftover
|
||||
*
|
||||
* @compile/fail ExtraneousEquals.java
|
||||
* @compile/fail/ref=ExtraneousEquals.out -XDrawDiagnostics ExtraneousEquals.java
|
||||
*/
|
||||
|
||||
public class ExtraneousEquals {
|
||||
|
|
6
langtools/test/tools/javac/ExtraneousEquals.out
Normal file
6
langtools/test/tools/javac/ExtraneousEquals.out
Normal file
|
@ -0,0 +1,6 @@
|
|||
ExtraneousEquals.java:10:23: compiler.err.illegal.start.of.expr
|
||||
ExtraneousEquals.java:10:24: compiler.err.illegal.start.of.expr
|
||||
ExtraneousEquals.java:10:25: compiler.err.expected: ';'
|
||||
ExtraneousEquals.java:10:28: compiler.err.not.stmt
|
||||
ExtraneousEquals.java:10:29: compiler.err.expected: ';'
|
||||
5 errors
|
|
@ -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 4629327
|
||||
* @summary Compiler crash on explicit use of synthetic name for inner class.
|
||||
* @author Neal Gafter
|
||||
*
|
||||
* @compile/fail FlatnameClash2.java
|
||||
* @compile/fail/ref=FlatnameClash2.out -XDrawDiagnostics FlatnameClash2.java
|
||||
*/
|
||||
|
||||
package tests;
|
||||
|
|
3
langtools/test/tools/javac/FlatnameClash2.out
Normal file
3
langtools/test/tools/javac/FlatnameClash2.out
Normal file
|
@ -0,0 +1,3 @@
|
|||
FlatnameClash2.java:32:22: compiler.err.cant.resolve.location: kindname.class, T1$Inner1, , , (compiler.misc.location: kindname.package, tests, null)
|
||||
FlatnameClash2.java:28:14: compiler.err.cant.apply.symbol: kindname.method, print, tests.T1.Inner1, tests.T2.Inner2, kindname.class, tests.T1, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: tests.T2.Inner2, tests.T1.Inner1))
|
||||
2 errors
|
|
@ -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 4041948
|
||||
* @summary javac previously allowed interfaces to inherit methods with
|
||||
* inconsistent signatures.
|
||||
* @author turnidge
|
||||
*
|
||||
* @compile/fail InconsistentInheritedSignature.java
|
||||
* @compile/fail/ref=InconsistentInheritedSignature.out -XDrawDiagnostics InconsistentInheritedSignature.java
|
||||
*/
|
||||
interface I1{
|
||||
int f();
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
InconsistentInheritedSignature.java:17:1: compiler.err.types.incompatible.diff.ret: I2, I1, f()
|
||||
1 error
|
Loading…
Add table
Add a link
Reference in a new issue