mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8044064: Group 1: create .out files for cast and capture negative tests in tools/javac dir
Reviewed-by: jjg
This commit is contained in:
parent
cd68d10b6f
commit
d15c9840ed
18 changed files with 39 additions and 228 deletions
|
@ -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.
|
* @bug 5044626
|
||||||
*
|
|
||||||
* 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 5044157
|
|
||||||
* @summary type system loophole in wildcard substitution
|
* @summary type system loophole in wildcard substitution
|
||||||
* @author Gilad Bracha
|
* @author Gilad Bracha
|
||||||
*
|
*
|
||||||
* @compile/fail CaptureInSubtype.java
|
* @compile/fail/ref=CaptureInSubtype.out -XDrawDiagnostics CaptureInSubtype.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
2
langtools/test/tools/javac/CaptureInSubtype.out
Normal file
2
langtools/test/tools/javac/CaptureInSubtype.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
CaptureInSubtype.java:38:17: compiler.err.override.incompatible.ret: (compiler.misc.cant.override: m(), CaptureInSubtype.ShowFlaw, m(), CaptureInSubtype.SuperOfShowFlaw), CaptureInSubtype.Flaw<?>, CaptureInSubtype.SuperOfFlaw<java.util.List<?>>
|
||||||
|
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 5029773
|
* @bug 5029773
|
||||||
* @summary soundness problem with failure to subsitute wildcard as type formal argument
|
* @summary soundness problem with failure to substitute wildcard as type formal argument
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail Capture2.java
|
* @compile/fail/ref=Capture2.out -XDrawDiagnostics Capture2.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package capture2;
|
package capture2;
|
||||||
|
|
2
langtools/test/tools/javac/capture/Capture2.out
Normal file
2
langtools/test/tools/javac/capture/Capture2.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Capture2.java:17:23: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.type.captureof: 1, ?, T)
|
||||||
|
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 6384510
|
* @bug 6384510
|
||||||
* @summary improper handling of wildcard captures
|
* @summary improper handling of wildcard captures
|
||||||
* @author Martin Buchholz
|
* @author Martin Buchholz
|
||||||
* @compile/fail Martin.java
|
* @compile/fail/ref=Martin.out -XDrawDiagnostics Martin.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
2
langtools/test/tools/javac/capture/Martin.out
Normal file
2
langtools/test/tools/javac/capture/Martin.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Martin.java:15:11: compiler.err.cant.apply.symbols: kindname.method, addAll, java.util.List<compiler.misc.type.captureof: 1, ?>,{(compiler.misc.inapplicable.method: kindname.method, java.util.Collection, addAll(java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.util.List<compiler.misc.type.captureof: 1, ?>, java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, addAll(java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.util.List<compiler.misc.type.captureof: 1, ?>, java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, addAll(int,java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>), (compiler.misc.arg.length.mismatch))}
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008, 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 6594284
|
* @bug 6594284
|
||||||
* @summary NPE thrown when calling a method on an intersection type
|
* @summary NPE thrown when calling a method on an intersection type
|
||||||
* @author Maurizio Cimadamore
|
* @author Maurizio Cimadamore
|
||||||
*
|
*
|
||||||
* @compile/fail T6594284.java
|
* @compile/fail/ref=T6594284.out -XDrawDiagnostics T6594284.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class T6594284 {
|
public class T6594284 {
|
||||||
|
|
2
langtools/test/tools/javac/capture/T6594284.out
Normal file
2
langtools/test/tools/javac/capture/T6594284.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
T6594284.java:18:24: compiler.err.not.within.bounds: ? extends T6594284.E, T
|
||||||
|
1 error
|
|
@ -1,31 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2006, 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 5064736
|
* @bug 5064736
|
||||||
* @summary Incompatible types are cast without error
|
* @summary Incompatible types are cast without error
|
||||||
* @compile/fail T5064736.java
|
* @compile/fail/ref=T5064736.out -XDrawDiagnostics T5064736.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class T5064736 {
|
public class T5064736 {
|
||||||
|
|
2
langtools/test/tools/javac/cast/5064736/T5064736.out
Normal file
2
langtools/test/tools/javac/cast/5064736/T5064736.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
T5064736.java:14:34: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: T5064736.Foo<compiler.misc.type.captureof: 1, ? super T5064736.A>, T5064736.Foo<U>)
|
||||||
|
1 error
|
|
@ -1,31 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2006, 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 6219964
|
* @bug 6219964
|
||||||
* @summary Compiler allows illegal cast of anonymous inner class
|
* @summary Compiler allows illegal cast of anonymous inner class
|
||||||
* @compile/fail T6219964.java
|
* @compile/fail/ref=T6219964.out -XDrawDiagnostics T6219964.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class T6219964 {
|
public class T6219964 {
|
||||||
|
|
2
langtools/test/tools/javac/cast/6219964/T6219964.out
Normal file
2
langtools/test/tools/javac/cast/6219964/T6219964.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
T6219964.java:13:27: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: compiler.misc.anonymous.class: java.lang.Object, T6219964.I)
|
||||||
|
1 error
|
|
@ -1,31 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2006, 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 6302956
|
* @bug 6302956
|
||||||
* @summary Illegal cast allowed Properties -> Map<String, String>
|
* @summary Illegal cast allowed Properties -> Map<String, String>
|
||||||
* @compile/fail T6302956.java
|
* @compile/fail/ref=T6302956.out -XDrawDiagnostics T6302956.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
2
langtools/test/tools/javac/cast/6302956/T6302956.out
Normal file
2
langtools/test/tools/javac/cast/6302956/T6302956.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
T6302956.java:12:57: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.util.Properties, java.util.Map<java.lang.String,java.lang.String>)
|
||||||
|
1 error
|
|
@ -1,33 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
* @test /nodynamiccopyright/
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* @bug 6548436
|
||||||
*
|
|
||||||
* 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 6548436
|
|
||||||
* @summary Incorrect inconvertible types error
|
* @summary Incorrect inconvertible types error
|
||||||
* @author Maurizio Cimadamore
|
* @author Maurizio Cimadamore
|
||||||
*
|
*
|
||||||
* @compile/fail T6548436d.java
|
* @compile/fail/ref=T6548436d.out -XDrawDiagnostics T6548436d.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class T6548436d {
|
public class T6548436d {
|
||||||
|
|
2
langtools/test/tools/javac/cast/6548436/T6548436d.out
Normal file
2
langtools/test/tools/javac/cast/6548436/T6548436d.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
T6548436d.java:15:35: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: T6548436d.Base<compiler.misc.type.captureof: 1, ? extends java.lang.Double>, T6548436d.Base<java.lang.Integer>)
|
||||||
|
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 5014309
|
* @bug 5014309
|
||||||
* @summary REGRESSION: compiler allows cast from Integer[] to int[]
|
* @summary REGRESSION: compiler allows cast from Integer[] to int[]
|
||||||
* @author gafter
|
* @author gafter
|
||||||
*
|
*
|
||||||
* @compile/fail BoxedArray.java
|
* @compile/fail/ref=BoxedArray.out -XDrawDiagnostics BoxedArray.java
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class BoxedArray {
|
public class BoxedArray {
|
||||||
|
|
2
langtools/test/tools/javac/cast/BoxedArray.out
Normal file
2
langtools/test/tools/javac/cast/BoxedArray.out
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
BoxedArray.java:13:22: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.lang.Integer[], int[])
|
||||||
|
1 error
|
Loading…
Add table
Add a link
Reference in a new issue