mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
method refs: non-raw receiver type should influence collected constraints (IDEA-140002)
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
import java.util.*;
|
||||
import java.util.function.BinaryOperator;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collector;
|
||||
|
||||
class Test {
|
||||
public static <T5> Collector<T5, Set<T5>, Set<T5>> foo(Supplier<Set<T5>> setConstructor,
|
||||
BinaryOperator<Set<T5>> rBinaryOperator) {
|
||||
|
||||
return Collector.of(setConstructor, Set<T5>:: add, rBinaryOperator);
|
||||
}
|
||||
|
||||
public static <T> Collector<T, Set<T>, Set<T>> foo() {
|
||||
final Supplier<Set<T>> setConstructor = HashSet::new;
|
||||
|
||||
return Collector.of(
|
||||
setConstructor,
|
||||
Set<T>::add,
|
||||
(Set<T> s1, Set<T> s2) -> {
|
||||
s1.addAll(s2);
|
||||
return s1;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user