* Jim Laskey:

> All discussion is valid. I agree the ambiguity is tricky, but can be
> resolved by using explicit locale.
>
> Example:
>
>       "%s".formatted(Locale.getDefault(), Locale.JAPAN);
>
> This guarantees the "public String formatted(Locale l,
> Object... args)" form is chosen with the second Locale as an argument.

There is also the cognitive overhead.  I think the key question is
whether this is so bad:

  String.format(Locale.US, """
  %s
  """, Locale.JAPAN);

Then perhaps we wouldn't need the formatted method which takes a Locale
object.

Thanks,
Florian

Reply via email to