This commit is contained in:
VampireAchao 2022-02-11 19:15:09 +08:00 committed by achao
parent a0f172d584
commit 88a7fc7dc0

View File

@ -114,7 +114,8 @@ public class CollectorUtil {
if (downstream.characteristics().contains(Collector.Characteristics.IDENTITY_FINISH)) {
return new SimpleCollector<>(mangledFactory, accumulator, merger, CH_ID);
} else {
UnaryOperator<A> downstreamFinisher = (UnaryOperator<A>) downstream.finisher();
@SuppressWarnings("unchecked")
Function<A, A> downstreamFinisher = (Function<A, A>) downstream.finisher();
Function<Map<K, A>, M> finisher = intermediate -> {
intermediate.replaceAll((k, v) -> downstreamFinisher.apply(v));
@SuppressWarnings("unchecked")