提交 0c16e8c8 编写于 作者: V vromero

8022622: javac, two tests are failing with compile time error after class Collector was modified

Reviewed-by: mcimadamore
上级 d062cca8
...@@ -34,15 +34,15 @@ import java.util.stream.*; ...@@ -34,15 +34,15 @@ import java.util.stream.*;
class TargetType59 { class TargetType59 {
<T, R> Collector<T, R> m(Supplier<? extends R> supplier, BiConsumer<R, T> accumulator) { <T, R> Collector<T, String, R> m(Supplier<? extends R> supplier, BiConsumer<R, T> accumulator) {
return null; return null;
} }
<T, C extends Collection<T>> Collector<T,C> test1(Supplier<C> collectionFactory) { <T, C extends Collection<T>> Collector<T, String, C> test1(Supplier<C> collectionFactory) {
return m(collectionFactory, Collection::add); return m(collectionFactory, Collection::add);
} }
Collector<String, StringBuilder> test2(Supplier<StringBuilder> sb) { Collector<String, String, StringBuilder> test2(Supplier<StringBuilder> sb) {
return m(sb, StringBuilder::append); return m(sb, StringBuilder::append);
} }
} }
...@@ -38,8 +38,8 @@ class TargetType61 { ...@@ -38,8 +38,8 @@ class TargetType61 {
return g(classifier, TreeMap::new, m(HashSet::new)); return g(classifier, TreeMap::new, m(HashSet::new));
} }
<R> Collector<Integer, R> m(Supplier<R> s) { return null; } <R> Collector<Integer, String, R> m(Supplier<R> s) { return null; }
<T, K, D, M extends Map<K, D>> <T, K, D, M extends Map<K, D>>
Collector<T, M> g(Function<T, K> classifier, Supplier<M> mapFactory, Collector<T, D> downstream) { return null; } Collector<T, String, M> g(Function<T, K> classifier, Supplier<M> mapFactory, Collector<T, String, D> downstream) { return null; }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册