Hello!

Thank you for your suggestions. I see that there's a general
preference towards adding a static method to the Collectors class, so
let's move in this direction. So far, I've seen several proposals for
the method name:
- formatting
- listFormatting
- joiningLocalized

Regarding the overload, accepting the Locale instance. From our
experience, type=OR is also used quite often. In our codebase we
provide wrapper methods for three styles, which are recommended to
use:
'and': STANDARD+FULL
'narrowAnd': STANDARD+NARROW
'or': OR+FULL

Their uses across our codebase:
'and': 16 direct uses + 6 Collector uses = 22 in total
'or': 13 direct uses + 5 Collector uses = 18 in total
'narrowAnd': 8 direct uses + 2 Collector uses = 10 in total

So I would disagree that uses of STANDARD+FULL are overwhelming
(though the dataset is pretty small).
If we are to provide the overloads accepting the Locale, I would at
least add a hint to the used type into the method name. We use
'formattingAnd' and 'formattingOr'. Not sure if it sounds good enough
for the standard library, but it's pretty clear for our developers.

With best regards,
Tagir Valeev

On Wed, Sep 9, 2026 at 6:22 PM Naoto Sato <[email protected]> wrote:
>
> I am fine with Collectors.formatting().
>
> On 9/9/26 7:36 AM, Alan Bateman wrote:
> >
> > One other thought on this. If the 95% usage is type=STANDARD and
> > style=FULL then a simple formatting(Locale) would push ListFormat out of
> > sight, making it look like it was always there, like joining.
> I was thinking the same thing, i.e., taking a Locale instead of a
> ListFormat instance. This may be preferable if that's how it's used mostly.
>
> Naoto

Reply via email to