8074514: Group 13d: golden files for tests in tools/javac/generics dir

Reviewed-by: jjg
This commit is contained in:
Sonali Goel 2015-05-15 17:43:21 -07:00
parent 8f711841fa
commit e16a945d3c
22 changed files with 49 additions and 275 deletions

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 4965756
* @summary no covariant returns involving primitives
* @author gafter
*
* @compile/fail Covar4.java
* @compile/fail/ref=Covar4.out -XDrawDiagnostics Covar4.java
*/
public class Covar4 {

View File

@ -0,0 +1,2 @@
Covar4.java:15:20: compiler.err.override.incompatible.ret: (compiler.misc.cant.override: f(), Covar4.B1, f(), Covar4.A1), int, long
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 4951670
* @summary javac crash with improper overrider
* @author gafter
*
* @compile/fail ErasureClashCrash.java
* @compile/fail/ref=ErasureClashCrash.out -XDrawDiagnostics ErasureClashCrash.java
*/
interface Compar<T> {

View File

@ -0,0 +1,2 @@
ErasureClashCrash.java:14:16: compiler.err.name.clash.same.erasure.no.override: compareTo(java.lang.Object), ErasureClashCrash, compareTo(T), Compar, compareTo(java.lang.Object), ErasureClashCrash
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 4982096 5004321
* @summary the type in an instanceof expression must be reifiable
* @author seligman
*
* @compile/fail InstanceOf2.java
* @compile/fail/ref=InstanceOf2.out -XDrawDiagnostics InstanceOf2.java
*/
public class InstanceOf2 {

View File

@ -0,0 +1,2 @@
InstanceOf2.java:12:48: compiler.err.illegal.generic.type.for.instof
1 error

View File

@ -1,33 +1,10 @@
/*
* Copyright (c) 2001, 2007, 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 4607420
* @summary A bug in the original JSR14 generics specification
* created a loophole in the type system.
*
* @compile/fail Nonlinear.java
* @compile/fail/ref=Nonlinear.out -XDrawDiagnostics Nonlinear.java
*/

View File

@ -0,0 +1,3 @@
Nonlinear.java:35:36: compiler.err.prob.found.req: (compiler.misc.incompatible.eq.bounds: A, B,A)
Nonlinear.java:71:45: compiler.err.prob.found.req: (compiler.misc.incompatible.eq.bounds: A, B,A,A)
2 errors

View File

@ -1,33 +1,10 @@
/*
* Copyright (c) 2003, 2014, 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 4948130
* @summary casting conversion checks changed for covariant returns
* @author gafter
*
* @compile/fail RefEqual.java
* @compile/fail/ref=RefEqual.out -XDrawDiagnostics RefEqual.java
*/
class RefEqual {

View File

@ -0,0 +1,2 @@
RefEqual.java:13:26: compiler.err.incomparable.types: java.lang.Class<java.lang.String>, java.lang.Class<java.lang.Integer>
1 error

View File

@ -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 4695348
* @summary generics: compiler allows ref to type bounds in static members
* @author gafter
*
* @compile/fail T4695348.java
* @compile/fail/ref=T4695348.out -XDrawDiagnostics T4695348.java
*/
class T4695348<T> {

View File

@ -0,0 +1,2 @@
T4695348.java:11:12: compiler.err.non-static.cant.be.ref: kindname.type.variable, 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 4881265
* @summary generics: compiler allows T.class for type variable T
* @author gafter
*
* @compile/fail TyparamLit.java
* @compile/fail/ref=TyparamLit.out -XDrawDiagnostics TyparamLit.java
*/
class TyparamLit<T> {

View File

@ -0,0 +1,2 @@
TyparamLit.java:11:16: compiler.err.type.var.cant.be.deref
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 5046972
* @summary type parameter referenced in static inner class improperly allowed!
* @author gafter
*
* @compile/fail TyparamStaticScope2.java
* @compile/fail/ref=TyparamStaticScope2.out -XDrawDiagnostics TyparamStaticScope2.java
*/
package typaram.static_.scope2;

View File

@ -0,0 +1,2 @@
TyparamStaticScope2.java:13:40: compiler.err.non-static.cant.be.ref: kindname.type.variable, T
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 5020448
* @summary Generic method allowing passing of types that don't match collection types
* @author gafter
*
* @compile/fail UnsoundInference.java
* @compile/fail/ref=UnsoundInference.out -XDrawDiagnostics UnsoundInference.java
*/
import java.util.ArrayList;

View File

@ -0,0 +1,2 @@
UnsoundInference.java:18:9: compiler.err.cant.apply.symbol: kindname.method, transferBug, Var[],java.util.Collection<Var>, java.lang.Object[],java.util.ArrayList<java.lang.String>, kindname.class, UnsoundInference, (compiler.misc.incompatible.eq.lower.bounds: Var, java.lang.String, java.lang.Object)
1 error

View File

@ -1,35 +1,12 @@
/*
* 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 5073079
* @summary Allow unchecked override of generified methods in
* parameterless classes
* @author Peter von der Ah\u00e9
*
* @compile Warn1.java
* @compile/fail -Xlint:unchecked -Werror Warn1.java
* @compile/fail/ref=Warn1.out -XDrawDiagnostics -Xlint:unchecked -Werror Warn1.java
*/
interface Attribute<T> { }

View File

@ -0,0 +1,4 @@
Warn1.java:19:22: compiler.warn.override.unchecked.ret: (compiler.misc.unchecked.implement: get(java.lang.Class), AttributeSet1Impl, <T>get(java.lang.Class<T>), AttributeSet1), Attribute, Attribute<T>
- compiler.err.warnings.and.werror
1 error
1 warning

View File

@ -1,35 +1,12 @@
/*
* 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 5073079
* @summary Allow unchecked override of generified methods in
* parameterless classes
* @author Peter von der Ah\u00e9
*
* @compile Warn2.java
* @compile/fail -Xlint:unchecked -Werror Warn2.java
* @compile/fail/ref=Warn2.out -XDrawDiagnostics -Xlint:unchecked -Werror Warn2.java
*/
interface I3 {

View File

@ -0,0 +1,4 @@
Warn2.java:17:19: compiler.warn.override.unchecked.ret: (compiler.misc.unchecked.implement: foo(), C3, <T>foo(), I3), java.lang.Object, T
- compiler.err.warnings.and.werror
1 error
1 warning