On Tue, 22 Sep 2026 13:40:28 GMT, Tagir F. Valeev <[email protected]> wrote:

>> yes, I agree
>
> @naotoj what do you think about formatting an empty stream? In my opinion, 
> it's almost never correct in practical code to use an empty string there, as 
> the final message will be unreadable. An empty case should always be handled 
> separately (probably not displaying the message at all or displaying an 
> entirely different message). In this sense, throwing an exception is a good 
> thing, as it will help to catch an unprocessed corner case. On the other 
> hand, the consistency argument is valid: if existing `joining(", ")` returns 
> an empty string, then it's probably expected to see the same from the new 
> collector. What do you think? This question is still valid, even if we move 
> to `joiningConjunctively`, etc.

My take is that we should follow the convention of `Collectors.joining()`, 
otherwise it would be surprising for users to see an exception for the same 
stream (ie, empty) with the (pseudo-)overload.

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

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

Reply via email to