RFR: 8328316: Finisher cannot emit if stream is sequential and integrator returned false

Paul Sandoz psandoz at openjdk.org
Wed Mar 20 23:14:20 UTC 2024


On Mon, 18 Mar 2024 16:27:13 GMT, Viktor Klang <vklang at openjdk.org> wrote:

> Adds differentiation between direct and transitive short circuiting which could prevent pushing downstream in the finisher for built-ins that were not `collect()`.
> 
> Creating this as a draft PR for now, just need to run some benchmarks to validate no significant regressions first.

Looks good, just a minor suggestion.

test/jdk/java/util/stream/GathererShortCircuitTest.java line 48:

> 46:                 Gatherer.of(
> 47:                     (unused, element, downstream) -> false,
> 48:                     (unused, downstream) -> downstream.push(expected)

Suggestion:

                    (_, element, downstream) -> false,
                    (_ downstream) -> downstream.push(expected)

-------------

Marked as reviewed by psandoz (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18351#pullrequestreview-1950412052
PR Review Comment: https://git.openjdk.org/jdk/pull/18351#discussion_r1533025318


More information about the core-libs-dev mailing list