On Sat, 26 Sep 2026 10:29:49 GMT, Tagir F. Valeev <[email protected]> wrote:

>> Collectors joiningConjunctively and joiningDisjunctively were added to 
>> Collectors. In addition, we have ListFormat.toCollector to convert any 
>> ListFormat.
>> 
>> For testing, I tested a couple of scenarios and a few corner cases (empty 
>> stream, null element, parallel stream) in a simple non-parameterized JUnit 
>> test. I believe that it's enough, given that the implementation is trivial, 
>> and ListFormat itself, as well as Stream API is already thoroughly tested by 
>> other tests. Tell me if you feel that some testing scenarios are missing, 
>> I'll happily add them.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Tagir F. Valeev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   8391789: Empty input test fixed

src/java.base/share/classes/java/util/stream/Collectors.java line 351:

> 349:      *
> 350:      * <p>For example, if the input stream contains three elements 
> {@code "a"}, {@code "b"},
> 351:      * and {@code "c"}, collecting it with {@code 
> joiningConjunctively(Locale.ENGLISH)}

Since the example uses the Oxford comma, I'd prefer `Locale.US` over the 
language-only `Locale.ENGLISH`. For comparison, `Locale.UK` formats the same 
list without the Oxford comma.

src/java.base/share/classes/java/util/stream/Collectors.java line 372:

> 370:      *
> 371:      * <p>For example, if the input stream contains three elements 
> {@code "a"}, {@code "b"},
> 372:      * and {@code "c"}, collecting it with {@code 
> joiningConjunctively(Locale.ENGLISH)}

You meant `joiningDisjunctively` here, right?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32716#discussion_r4149315105
PR Review Comment: https://git.openjdk.org/jdk/pull/32716#discussion_r4149325195

Reply via email to