File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,8 +47,9 @@ are equivalent.
4747 12+ min/max pair over the same input, and primitive stream terminal operations for primitive
4848 totals.
49493 . Flatten nested sources deliberately. Use ` flatMap ` for nested collections and
50- ` flatMap(Optional::stream) ` on Java 9+. On Java 16+, prefer ` mapMulti ` for mixed subtype checks or
51- small conditional emission; use primitive streams for primitive results.
50+ ` flatMap(Optional::stream) ` on Java 9+. On Java 16+, prefer ` mapMulti ` for small conditional
51+ reference-value emission. For primitive values from a subtype, filter/cast first, then use
52+ ` mapToInt ` /` mapToLong ` /` mapToDouble ` directly; do not emit boxed primitives only to unbox them.
52534 . Use primitive streams for primitive aggregation. Keep and explicitly classify `reduce(identity,
5354 op)` as acceptable for immutable non-primitive accumulation such as ` BigDecimal`.
54555 . Choose collectors by result semantics, and state duplicate-key/null contracts explicitly. When a
You can’t perform that action at this time.
0 commit comments