diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn2.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn.java similarity index 58% rename from langtools/test/tools/javac/generics/wildcards/neg/CastWarn2.java rename to langtools/test/tools/javac/generics/wildcards/neg/CastWarn.java index 1ee83bb8d37..5d34dd52c5a 100644 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn2.java +++ b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -24,15 +24,15 @@ /* * @test * @bug 4916607 - * @summary Test casts (legal, warning, and errors) + * @summary Test casts (warning) * @author gafter * - * @compile/fail -Werror -Xlint:unchecked CastWarn2.java + * @compile/ref=CastWarn.out -XDrawDiagnostics -Xlint:unchecked CastWarn.java */ import java.util.*; -class CastTest { +class CastWarn { // --- Disjoint --- @@ -43,7 +43,24 @@ class CastTest { private void disjointness() { Object o; + // Classes o = (DA) (DA) null; // <> - } + o = (DA) (DA) null; // <> + o = (DA) (DA) null; // <> + // Typevars + o = (DA) (DA) null; // <> + o = (DA) (DA) null; // <> + o = (DA) (DA) null; // <> + o = (DA) (DA) null; // <> + + o = (DA) (DA) null; // <> + o = (DA) (DA) null; // <> + + // Raw (asymmetrical!) + o = (DA) (DB) null; // <> + o = (DA) (DB) null; // <> + o = (DB) (DA) null; // <> + o = (DB) (DA) null; // <> + } } diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn.out b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn.out new file mode 100644 index 00000000000..b5b60868ec2 --- /dev/null +++ b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn.out @@ -0,0 +1,14 @@ +CastWarn.java:47:38: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DA +CastWarn.java:48:35: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DA +CastWarn.java:49:34: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DA +CastWarn.java:52:37: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DA +CastWarn.java:53:21: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DA +CastWarn.java:54:21: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DA +CastWarn.java:55:21: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DA +CastWarn.java:57:21: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DA +CastWarn.java:58:21: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DA +CastWarn.java:61:26: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DB, CastWarn.DA +CastWarn.java:62:36: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DB, CastWarn.DA +CastWarn.java:63:26: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DB +CastWarn.java:64:36: compiler.warn.prob.found.req: (compiler.misc.unchecked.cast.to.type), CastWarn.DA, CastWarn.DB +13 warnings diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn10.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn10.java deleted file mode 100644 index 1f49aa7a21b..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn10.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn10.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DA) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn11.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn11.java deleted file mode 100644 index d7d48defd17..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn11.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn11.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DB) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn12.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn12.java deleted file mode 100644 index 444ec34966c..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn12.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn12.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DB) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn13.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn13.java deleted file mode 100644 index 4109f582e3b..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn13.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn13.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DB) (DA) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn14.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn14.java index db958f78052..09b45651628 100644 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn14.java +++ b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn14.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -139,43 +139,29 @@ class CastTest { o = (DA) (DA) null; // <> o = (DA) (DA) null; // <> - o = (DA) (DA) null; // <> o = (DA) (DA) null; // <> - o = (DA) (DA) null; // <> o = (DA) (DA) null; // <> o = (DA) (DA) null; // <> - o = (DA) (DA) null; // <> o = (DA) (DA) null; // <> o = (DA) (DA) null; // <> // Typevars o = (DA) (DA) null; // <> - o = (DA) (DA) null; // <> o = (DA) (DA) null; // <> - o = (DA) (DA) null; // <> - o = (DA) (DA) null; // <> - o = (DA) (DA) null; // <> - - o = (DA) (DA) null; // <> - o = (DA) (DA) null; // <> o = (DA) (DA) null; // <> // Raw (asymmetrical!) o = (DA) (DB) null; // <> - o = (DA) (DB) null; // <> o = (DA) (DB) null; // <> o = (DA) (DB) null; // <> - o = (DA) (DB) null; // <> o = (DB) (DA) null; // <> - o = (DB) (DA) null; // <> o = (DB) (DA) null; // <> o = (DB) (DA) null; // <> - o = (DB) (DA) null; // <> o = (DC) (DA) null; // <> o = (DC) (DA) null; // <> diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn3.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn3.java deleted file mode 100644 index 21b92f1b963..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn3.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn3.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DA) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn4.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn4.java deleted file mode 100644 index 61571a80cf0..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn4.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn4.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DA) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn5.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn5.java deleted file mode 100644 index b72a12d4329..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn5.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn5.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DA) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn6.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn6.java deleted file mode 100644 index f32dd02734a..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn6.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn6.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DA) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn7.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn7.java deleted file mode 100644 index 9fbfb2a2c63..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn7.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn7.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DA) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn8.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn8.java deleted file mode 100644 index 477219a6f63..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn8.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn8.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DA) null; // <> - } - -} diff --git a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn9.java b/langtools/test/tools/javac/generics/wildcards/neg/CastWarn9.java deleted file mode 100644 index c647f3df662..00000000000 --- a/langtools/test/tools/javac/generics/wildcards/neg/CastWarn9.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * @bug 4916607 - * @summary Test casts (legal, warning, and errors) - * @author gafter - * - * @compile/fail -Werror -Xlint:unchecked CastWarn9.java - */ - -import java.util.*; - -class CastTest { - - // --- Disjoint --- - - private interface DA { } - private interface DB extends DA { } - private interface DC extends DA { } - - private void disjointness() { - Object o; - - o = (DA) (DA) null; // <> - } - -}