Merge

Wed, 19 Nov 2014 16:25:39 -0800

author
asaha
date
Wed, 19 Nov 2014 16:25:39 -0800
changeset 2743
e2c6204e7ed1
parent 2742
f89d4eaa6484
parent 2663
d7024b4bd5a2
child 2744
d4c7822e9d64

Merge

.hgtags file | annotate | diff | comparison | revisions
     1.1 --- a/.hgtags	Thu Nov 06 09:49:49 2014 -0800
     1.2 +++ b/.hgtags	Wed Nov 19 16:25:39 2014 -0800
     1.3 @@ -356,4 +356,6 @@
     1.4  d3c93dc64c5e1ffd610fb31362a78bedfd8097ba jdk8u40-b11
     1.5  e7560bceb36a933f5eb6ce8c33dce030ba0288f2 jdk8u40-b12
     1.6  88ce114c6adc387dc7fc5831b8263f152f0412fb jdk8u40-b13
     1.7 +f18c5b47f27b387d94487890684abe5a554b0d9b jdk8u40-b14
     1.8 +682a6c1aefd766eaf774ffeb1207a5189edf94d6 jdk8u40-b15
     1.9  dbae37f50c43453f7d6f22d96adc8b5b6cd1e90d jdk8u45-b00
     2.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Nov 06 09:49:49 2014 -0800
     2.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Nov 19 16:25:39 2014 -0800
     2.3 @@ -3624,7 +3624,8 @@
     2.4              for (Type erasedSupertype : mec) {
     2.5                  List<Type> lci = List.of(asSuper(ts[startIdx], erasedSupertype.tsym));
     2.6                  for (int i = startIdx + 1 ; i < ts.length ; i++) {
     2.7 -                    lci = intersect(lci, List.of(asSuper(ts[i], erasedSupertype.tsym)));
     2.8 +                    Type superType = asSuper(ts[i], erasedSupertype.tsym);
     2.9 +                    lci = intersect(lci, superType != null ? List.of(superType) : List.<Type>nil());
    2.10                  }
    2.11                  candidates = candidates.appendList(lci);
    2.12              }
     3.1 --- a/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Nov 06 09:49:49 2014 -0800
     3.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Nov 19 16:25:39 2014 -0800
     3.3 @@ -784,7 +784,10 @@
     3.4                      while (tmpTail.nonEmpty()) {
     3.5                          Type b1 = boundList.head;
     3.6                          Type b2 = tmpTail.head;
     3.7 -                        if (b1 != b2) {
     3.8 +                        /* This wildcard check is temporary workaround. This code may need to be
     3.9 +                         * revisited once spec bug JDK-7034922 is fixed.
    3.10 +                         */
    3.11 +                        if (b1 != b2 && !b1.hasTag(WILDCARD) && !b2.hasTag(WILDCARD)) {
    3.12                              Pair<Type, Type> commonSupers = infer.getParameterizedSupers(b1, b2);
    3.13                              if (commonSupers != null) {
    3.14                                  List<Type> allParamsSuperBound1 = commonSupers.fst.allparams();
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/tools/javac/lambda/T8057800/NPEMethodReferenceAndGenericsTest.java	Wed Nov 19 16:25:39 2014 -0800
     4.3 @@ -0,0 +1,39 @@
     4.4 +/*
     4.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
     4.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.7 + *
     4.8 + * This code is free software; you can redistribute it and/or modify it
     4.9 + * under the terms of the GNU General Public License version 2 only, as
    4.10 + * published by the Free Software Foundation.  Oracle designates this
    4.11 + * particular file as subject to the "Classpath" exception as provided
    4.12 + * by Oracle in the LICENSE file that accompanied this code.
    4.13 + *
    4.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    4.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    4.17 + * version 2 for more details (a copy is included in the LICENSE file that
    4.18 + * accompanied this code).
    4.19 + *
    4.20 + * You should have received a copy of the GNU General Public License version
    4.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    4.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    4.23 + *
    4.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    4.25 + * or visit www.oracle.com if you need additional information or have any
    4.26 + * questions.
    4.27 + */
    4.28 +
    4.29 +/**
    4.30 + * @test
    4.31 + * @bug 8057800
    4.32 + * @summary Method reference with generic type creates NPE when compiling
    4.33 + * @compile NPEMethodReferenceAndGenericsTest.java
    4.34 + */
    4.35 +
    4.36 +public class NPEMethodReferenceAndGenericsTest {
    4.37 +    public <T> void foo(java.util.Comparator<? super T> comparator) {}
    4.38 +
    4.39 +    public <C extends Comparable<? super C>> void foo() {
    4.40 +        foo(C::compareTo);
    4.41 +    }
    4.42 +}

mercurial