On Sat, 19 Sep 2026 16:44:24 GMT, Anthony Vanelverdinghe <[email protected]> 
wrote:

>> Tagir F. Valeev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   8391789: Dumb error fix
>
> src/java.base/share/classes/java/util/stream/Collectors.java line 368:
> 
>> 366:      *
>> 367:      * <p>The returned Collector requires at least one input element.
>> 368:      * It will throw {@link IllegalArgumentException} if there are no 
>> input elements.
> 
> This behavior is very unintuitive to me. I propose to return the empty string 
> if there are no input elements, like the existing `joining` methods do. In 
> particular, I'd expect to be able to refactor existing usages of `joining` by 
> simply replacing `stream.collect(joining(delimiter))` with 
> `stream.collect(joining(listFormat))`.

yes, I agree

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

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

Reply via email to