8055074: Group 9a: golden files for tests in tools/javac dir

Reviewed-by: jjg
This commit is contained in:
Sonali Goel 2014-08-29 00:42:42 -07:00
parent e2312f606b
commit f4dc4013f0
18 changed files with 38 additions and 225 deletions

View File

@ -1,33 +1,10 @@
/*
* 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/
* @bug 4906586
* @summary Missing ambiguity error when two methods are equally specific
* @author gafter
*
* @compile/fail Ambig3.java
* @compile/fail/ref=Ambig3.out -XDrawDiagnostics Ambig3.java
*/
class Test<T,E> {

View File

@ -0,0 +1,3 @@
Ambig3.java:14:14: compiler.err.name.clash.same.erasure: check(E), check(T)
Ambig3.java:20:1: compiler.err.concrete.inheritance.conflict: check(E), Test<java.lang.String,java.lang.String>, check(T), Test<java.lang.String,java.lang.String>, Test<java.lang.String,java.lang.String>
2 errors

View File

@ -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 5014305
* @summary Malformed annotation type with varargs parameter crashes javac
*
* @compile/fail BadAnnotation.java
* @compile/fail/ref=BadAnnotation.out -XDrawDiagnostics BadAnnotation.java
*/
@BadAnnotation(1)

View File

@ -0,0 +1,2 @@
BadAnnotation.java:11:29: compiler.err.intf.annotation.members.cant.have.params
1 error

View File

@ -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 5007379
* @summary Compiler allows inheritance of multiple methods with unrelated return types
* @author gafter
*
* @compile/fail BadCovar.java
* @compile/fail/ref=BadCovar.out -XDrawDiagnostics BadCovar.java
*/
package bad.covar;

View File

@ -0,0 +1,2 @@
BadCovar.java:22:10: compiler.err.types.incompatible.diff.ret: bad.covar.B, bad.covar.A, f()
1 error

View File

@ -1,33 +1,10 @@
/*
* 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 4049982
* @summary Compiler permitted invalid hex literal.
* @author turnidge
*
* @compile/fail BadHexConstant.java
* @compile/fail/ref=BadHexConstant.out -XDrawDiagnostics BadHexConstant.java
*/
public

View File

@ -0,0 +1,3 @@
BadHexConstant.java:12:14: compiler.err.invalid.hex.number
BadHexConstant.java:12:17: compiler.err.expected: token.identifier
2 errors

View File

@ -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 4980352
* @summary Verify compiler doesn't throw a NullPointerException when compiling.
* @author tball
*
* @compile/fail BoundClassError.java
* @compile/fail/ref=BoundClassError.out -XDrawDiagnostics BoundClassError.java
*/
public class BoundClassError <T extends String&Comparable<BoundClassError>> {}

View File

@ -0,0 +1,2 @@
BoundClassError.java:9:31: compiler.err.cant.inherit.diff.arg: java.lang.Comparable, BoundClassError, java.lang.String
1 error

View File

@ -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 4407643
* @summary javac throws NullPointerException for break to label outside of class
* @author gafter
*
* @compile/fail BreakAcrossClass.java
* @compile/fail/ref=BreakAcrossClass.out -XDrawDiagnostics BreakAcrossClass.java
*/
class BreakAcrossClass {

View File

@ -0,0 +1,2 @@
BreakAcrossClass.java:16:33: compiler.err.undef.label: M
1 error

View File

@ -1,34 +1,11 @@
/*
* Copyright (c) 1998, 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 4110534
* @summary The fix for 1240831 broke the compiler. It should
* report that class Abs cannot be instantiated.
* @author turnidge
*
* @compile/fail ClassIsAbstract.java
* @compile/fail/ref=ClassIsAbstract.out -XDrawDiagnostics ClassIsAbstract.java
*/
abstract class Abs {

View File

@ -0,0 +1,2 @@
ClassIsAbstract.java:16:9: compiler.err.abstract.cant.be.instantiated: Abs
1 error

View File

@ -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 4948144
* @summary Generics: assignment of Class to type parm's default should elicit error
* @author never
*
* @compile/fail ClassToTypeParm.java
* @compile/fail/ref=ClassToTypeParm.out -XDrawDiagnostics ClassToTypeParm.java
*/
class ClassToTypeParm<T> {

View File

@ -0,0 +1,2 @@
ClassToTypeParm.java:12:15: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.Class, T)
1 error

View File

@ -1,33 +1,10 @@
/*
* 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/
* @bug 4960369
* @summary drop compound boxing operations
* @author gafter
*
* @compile/fail CompoundBox.java
* @compile/fail/ref=CompoundBox.out -XDrawDiagnostics CompoundBox.java
*/
class CompoundBox {

View File

@ -0,0 +1,2 @@
CompoundBox.java:12:19: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: int, java.lang.Float)
1 error