On Sat, 19 Sep 2026 08:47:53 GMT, Tagir F. Valeev <[email protected]> wrote:

>> Three options were suggested about the new API:
>> - ListFormat.formatting()
>> - ListFormat.toCollector()
>> - Collectors.listFormatting(ListFormat) static method
>> I feel it should belong to ListFormat, but I'm open to discussions.
>> 
>> 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: Test for Collectors.joining((ListFormat)null)

After discussion, I updated the PR. Now, the new collector is named as 
`Collectors.joining(ListFormat)`. I feel it's the best option. As Rémi noticed, 
the overload ambiguity should not be the problem. The PR description is updated 
above.

Additionally, a small unrelated typo in the ListFormat.format spec is fixed.

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

PR Comment: https://git.openjdk.org/jdk/pull/32716#issuecomment-5740595136

Reply via email to