:trollface: 解决冲突

This commit is contained in:
achao
2022-09-07 15:57:29 +08:00
committed by VampireAchao
parent e847ff6501
commit b7d924b34d

View File

@@ -116,7 +116,7 @@ public class EntryStream<K, V> extends AbstractEnhancedWrappedStream<Map.Entry<K
return empty();
}
final Stream<Map.Entry<K, V>> stream = StreamSupport.stream(source.spliterator(), false)
.map(t -> new Entry<>(keyMapper.apply(t), valueMapper.apply(t)));
.map(t -> ofEntry(keyMapper.apply(t), valueMapper.apply(t)));
return new EntryStream<>(stream);
}
@@ -131,7 +131,7 @@ public class EntryStream<K, V> extends AbstractEnhancedWrappedStream<Map.Entry<K
*/
public static <K, V> EntryStream<K, V> of(Stream<? extends Map.Entry<K, V>> stream) {
return ObjUtil.isNull(stream) ?
empty() : new EntryStream<>(stream.map(Entry::new));
empty() : new EntryStream<>(stream.map(EntryStream::ofEntry));
}
/**
@@ -734,7 +734,7 @@ public class EntryStream<K, V> extends AbstractEnhancedWrappedStream<Map.Entry<K
@SuppressWarnings("unchecked")
static <K, V> Map.Entry<K, V> ofEntry(final Map.Entry<K, V> entry) {
return ObjUtil.defaultIfNull(
entry, e -> ofEntry(e.getKey(), e.getValue()), (Map.Entry<K, V>)EMPTY_ENTRY
entry, e -> ofEntry(e.getKey(), e.getValue()), (Map.Entry<K, V>) EMPTY_ENTRY
);
}