changeset 47353:7d02545ec122

delta applying patch for JDK-8187978
author vromero
date Mon, 02 Oct 2017 12:38:10 -0400
parents e7a1cb656fbb
children 855ee5fa0b18 b203f0ff35e8 f8381cc5159d 4e65cd35d23e cf678680408a 6f7840b45e98
files src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java test/langtools/tools/javac/capture/Martin.out test/langtools/tools/javac/lambda/8019480/T8019480.out
diffstat 3 files changed, 4 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Mon Oct 02 12:36:10 2017 -0400
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Mon Oct 02 12:38:10 2017 -0400
@@ -59,7 +59,6 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
-import java.util.LinkedList;
 import java.util.Map;
 import java.util.Set;
 import java.util.function.BiFunction;
@@ -4041,35 +4040,14 @@
         }
         //where
             private Map<Symbol, JCDiagnostic> mapCandidates() {
-                MostSpecificMap candidates = new MostSpecificMap();
+                Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<>();
                 for (Candidate c : resolveContext.candidates) {
                     if (c.isApplicable()) continue;
-                    candidates.put(c);
+                    candidates.put(c.sym, c.details);
                 }
                 return candidates;
             }
 
-            @SuppressWarnings("serial")
-            private class MostSpecificMap extends LinkedHashMap<Symbol, JCDiagnostic> {
-                private void put(Candidate c) {
-                    ListBuffer<Symbol> overridden = new ListBuffer<>();
-                    for (Symbol s : keySet()) {
-                        if (s == c.sym) {
-                            continue;
-                        }
-                        if (c.sym.overrides(s, (TypeSymbol)s.owner, types, false)) {
-                            overridden.add(s);
-                        } else if (s.overrides(c.sym, (TypeSymbol)c.sym.owner, types, false)) {
-                            return;
-                        }
-                    }
-                    for (Symbol s : overridden) {
-                        remove(s);
-                    }
-                    put(c.sym, c.details);
-                }
-            }
-
             Map<Symbol, JCDiagnostic> filterCandidates(Map<Symbol, JCDiagnostic> candidatesMap) {
                 Map<Symbol, JCDiagnostic> candidates = new LinkedHashMap<>();
                 for (Map.Entry<Symbol, JCDiagnostic> _entry : candidatesMap.entrySet()) {
--- a/test/langtools/tools/javac/capture/Martin.out	Mon Oct 02 12:36:10 2017 -0400
+++ b/test/langtools/tools/javac/capture/Martin.out	Mon Oct 02 12:38:10 2017 -0400
@@ -1,2 +1,2 @@
-Martin.java:15:11: compiler.err.cant.apply.symbols: kindname.method, addAll, java.util.List<compiler.misc.type.captureof: 1, ?>,{(compiler.misc.inapplicable.method: kindname.method, java.util.List, addAll(java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.util.List<compiler.misc.type.captureof: 1, ?>, java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, addAll(int,java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>), (compiler.misc.arg.length.mismatch))}
+Martin.java:15:11: compiler.err.cant.apply.symbols: kindname.method, addAll, java.util.List<compiler.misc.type.captureof: 1, ?>,{(compiler.misc.inapplicable.method: kindname.method, java.util.Collection, addAll(java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.util.List<compiler.misc.type.captureof: 1, ?>, java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, addAll(java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.util.List<compiler.misc.type.captureof: 1, ?>, java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, addAll(int,java.util.Collection<? extends compiler.misc.type.captureof: 2, ?>), (compiler.misc.arg.length.mismatch))}
 1 error
--- a/test/langtools/tools/javac/lambda/8019480/T8019480.out	Mon Oct 02 12:36:10 2017 -0400
+++ b/test/langtools/tools/javac/lambda/8019480/T8019480.out	Mon Oct 02 12:38:10 2017 -0400
@@ -1,3 +1,3 @@
-T8019480.java:21:34: compiler.err.cant.apply.symbols: kindname.method, add, java.lang.Object,{(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(U), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, U))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(int,U), (compiler.misc.arg.length.mismatch))}
+T8019480.java:21:34: compiler.err.cant.apply.symbols: kindname.method, add, java.lang.Object,{(compiler.misc.inapplicable.method: kindname.method, java.util.Collection, add(U), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, U))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(U), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.Object, U))),(compiler.misc.inapplicable.method: kindname.method, java.util.List, add(int,U), (compiler.misc.arg.length.mismatch))}
 T8019480.java:21:46: compiler.err.report.access: clone(), protected, java.lang.Object
 2 errors