Merge jdk8u40-b15

Fri, 14 Nov 2014 09:48:02 -0800

author
lana
date
Fri, 14 Nov 2014 09:48:02 -0800
changeset 2603
682a6c1aefd7
parent 2600
cf69984309bc
parent 2602
91cd351eff32
child 2604
74c51ff270c5
child 2606
f7f3f96999ba

Merge

     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Nov 12 13:47:23 2014 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Nov 14 09:48:02 2014 -0800
     1.3 @@ -3624,7 +3624,8 @@
     1.4              for (Type erasedSupertype : mec) {
     1.5                  List<Type> lci = List.of(asSuper(ts[startIdx], erasedSupertype.tsym));
     1.6                  for (int i = startIdx + 1 ; i < ts.length ; i++) {
     1.7 -                    lci = intersect(lci, List.of(asSuper(ts[i], erasedSupertype.tsym)));
     1.8 +                    Type superType = asSuper(ts[i], erasedSupertype.tsym);
     1.9 +                    lci = intersect(lci, superType != null ? List.of(superType) : List.<Type>nil());
    1.10                  }
    1.11                  candidates = candidates.appendList(lci);
    1.12              }
     2.1 --- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Nov 12 13:47:23 2014 -0800
     2.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Nov 14 09:48:02 2014 -0800
     2.3 @@ -784,7 +784,10 @@
     2.4                      while (tmpTail.nonEmpty()) {
     2.5                          Type b1 = boundList.head;
     2.6                          Type b2 = tmpTail.head;
     2.7 -                        if (b1 != b2) {
     2.8 +                        /* This wildcard check is temporary workaround. This code may need to be
     2.9 +                         * revisited once spec bug JDK-7034922 is fixed.
    2.10 +                         */
    2.11 +                        if (b1 != b2 && !b1.hasTag(WILDCARD) && !b2.hasTag(WILDCARD)) {
    2.12                              Pair<Type, Type> commonSupers = infer.getParameterizedSupers(b1, b2);
    2.13                              if (commonSupers != null) {
    2.14                                  List<Type> allParamsSuperBound1 = commonSupers.fst.allparams();
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/tools/javac/lambda/T8057800/NPEMethodReferenceAndGenericsTest.java	Fri Nov 14 09:48:02 2014 -0800
     3.3 @@ -0,0 +1,39 @@
     3.4 +/*
     3.5 + * Copyright (c) 2014, 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.  Oracle designates this
    3.11 + * particular file as subject to the "Classpath" exception as provided
    3.12 + * by Oracle in the LICENSE file that accompanied this code.
    3.13 + *
    3.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    3.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.17 + * version 2 for more details (a copy is included in the LICENSE file that
    3.18 + * accompanied this code).
    3.19 + *
    3.20 + * You should have received a copy of the GNU General Public License version
    3.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    3.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.23 + *
    3.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.25 + * or visit www.oracle.com if you need additional information or have any
    3.26 + * questions.
    3.27 + */
    3.28 +
    3.29 +/**
    3.30 + * @test
    3.31 + * @bug 8057800
    3.32 + * @summary Method reference with generic type creates NPE when compiling
    3.33 + * @compile NPEMethodReferenceAndGenericsTest.java
    3.34 + */
    3.35 +
    3.36 +public class NPEMethodReferenceAndGenericsTest {
    3.37 +    public <T> void foo(java.util.Comparator<? super T> comparator) {}
    3.38 +
    3.39 +    public <C extends Comparable<? super C>> void foo() {
    3.40 +        foo(C::compareTo);
    3.41 +    }
    3.42 +}

mercurial