test/tools/javac/generics/wildcards/T8051402/WildcardAndCAPSubtypeTest.java

Wed, 23 Jul 2014 10:18:55 -0400

author
vromero
date
Wed, 23 Jul 2014 10:18:55 -0400
changeset 2548
bf89a471779d
permissions
-rw-r--r--

8051467: javac, additional test case for JDK-8051402
Reviewed-by: mcimadamore, dlsmith

vromero@2548 1 /*
vromero@2548 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
vromero@2548 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
vromero@2548 4 *
vromero@2548 5 * This code is free software; you can redistribute it and/or modify it
vromero@2548 6 * under the terms of the GNU General Public License version 2 only, as
vromero@2548 7 * published by the Free Software Foundation.
vromero@2548 8 *
vromero@2548 9 * This code is distributed in the hope that it will be useful, but WITHOUT
vromero@2548 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
vromero@2548 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
vromero@2548 12 * version 2 for more details (a copy is included in the LICENSE file that
vromero@2548 13 * accompanied this code).
vromero@2548 14 *
vromero@2548 15 * You should have received a copy of the GNU General Public License version
vromero@2548 16 * 2 along with this work; if not, write to the Free Software Foundation,
vromero@2548 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
vromero@2548 18 *
vromero@2548 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
vromero@2548 20 * or visit www.oracle.com if you need additional information or have any
vromero@2548 21 * questions.
vromero@2548 22 */
vromero@2548 23
vromero@2548 24 /*
vromero@2548 25 * @test
vromero@2548 26 * @bug 8051402
vromero@2548 27 * @summary javac, type containment should accept that CAP <= ? extends CAP and CAP <= ? super CAP
vromero@2548 28 * @compile WildcardAndCAPSubtypeTest.java
vromero@2548 29 */
vromero@2548 30
vromero@2548 31 import java.util.List;
vromero@2548 32
vromero@2548 33 public abstract class WildcardAndCAPSubtypeTest {
vromero@2548 34 abstract <T> List<T> copyOf(List<? extends T> lx);
vromero@2548 35 abstract <E> List<E> filter(List<E> lx);
vromero@2548 36
vromero@2548 37 void g(List<?> lx) {
vromero@2548 38 copyOf(filter(lx));
vromero@2548 39 }
vromero@2548 40 }

mercurial