!538 修复lambda转换错误

Merge pull request !538 from 阿超/v5-dev
This commit is contained in:
Looly
2022-02-12 16:58:20 +00:00
committed by Gitee

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")