8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82

Mon, 15 Apr 2013 14:16:05 +0100

author
mcimadamore
date
Mon, 15 Apr 2013 14:16:05 +0100
changeset 1695
6dacab087652
parent 1694
083c6b199e2f
child 1696
c2315af9cc28

8011028: lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
Summary: Fix bug in Types.removeWildcards
Reviewed-by: jjg

src/share/classes/com/sun/tools/javac/code/Types.java file | annotate | diff | comparison | revisions
test/tools/javac/lambda/TargetType69.java file | annotate | diff | comparison | revisions
test/tools/javac/lambda/TargetType70.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Mon Apr 15 14:15:07 2013 +0100
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Mon Apr 15 14:16:05 2013 +0100
     1.3 @@ -589,7 +589,7 @@
     1.4                              CapturedType capVar = (CapturedType)capturedTypeargs.head;
     1.5                              //use declared bound if it doesn't depend on formal type-args
     1.6                              bound = capVar.bound.containsAny(capturedSite.getTypeArguments()) ?
     1.7 -                                    syms.objectType : capVar.bound;
     1.8 +                                    wt.type : capVar.bound;
     1.9                              break;
    1.10                          default:
    1.11                              bound = wt.type;
     2.1 --- a/test/tools/javac/lambda/TargetType69.java	Mon Apr 15 14:15:07 2013 +0100
     2.2 +++ b/test/tools/javac/lambda/TargetType69.java	Mon Apr 15 14:16:05 2013 +0100
     2.3 @@ -25,11 +25,11 @@
     2.4   * @test
     2.5   * @bug 8010303
     2.6   * @summary Graph inference: missing incorporation step causes spurious inference error
     2.7 - * @compile TargetType68.java
     2.8 + * @compile TargetType69.java
     2.9   */
    2.10  import java.util.*;
    2.11  
    2.12 -class TargetType68 {
    2.13 +class TargetType69 {
    2.14  
    2.15      interface Function<X,Y> {
    2.16          Y m(X x);
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/tools/javac/lambda/TargetType70.java	Mon Apr 15 14:16:05 2013 +0100
     3.3 @@ -0,0 +1,52 @@
     3.4 +/*
     3.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 + *
     3.8 + * This code is free software; you can redistribute it and/or modify it
     3.9 + * under the terms of the GNU General Public License version 2 only, as
    3.10 + * published by the Free Software Foundation.
    3.11 + *
    3.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    3.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.15 + * version 2 for more details (a copy is included in the LICENSE file that
    3.16 + * accompanied this code).
    3.17 + *
    3.18 + * You should have received a copy of the GNU General Public License version
    3.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    3.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.21 + *
    3.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.23 + * or visit www.oracle.com if you need additional information or have any
    3.24 + * questions.
    3.25 + */
    3.26 +
    3.27 +/*
    3.28 + * @test
    3.29 + * @bug 8011028
    3.30 + * @summary lang/INFR/infr001/infr00101md/infr00101md.java fails to compile after switch to JDK8-b82
    3.31 + * @compile TargetType70.java
    3.32 + */
    3.33 +class TargetType70  {
    3.34 +
    3.35 +    static class Sup {}
    3.36 +    static class Sub extends Sup {}
    3.37 +
    3.38 +    interface I<T extends GenSup<U>, U> {
    3.39 +        T m(U o);
    3.40 +    }
    3.41 +
    3.42 +    static class GenSup<T> {
    3.43 +        GenSup(T f) { }
    3.44 +    }
    3.45 +
    3.46 +    static class GenSub<T> extends GenSup<T> {
    3.47 +        GenSub(T f) { super(f); }
    3.48 +    }
    3.49 +
    3.50 +    <T extends Sup> void m(I<? extends GenSup<T>, T> o1, T o2) { }
    3.51 +
    3.52 +    void test(Sub sub) {
    3.53 +        m(GenSub::new, sub);
    3.54 +    }
    3.55 +}

mercurial