On Tue, 30 Jun 2026 19:40:00 GMT, Naoto Sato <[email protected]> wrote:
> I’d expect the specification of Locale.Builder.setLocale() to be updated,
> since this change causes it to throw IllformedLocaleException when the
> required compatibility extension is missing or has an incorrect value
@naotoj The method is already specified as,
> Locales with any ill-formed fields cause IllformedLocaleException to be
> thrown, except for the following three cases which are accepted for
> compatibility reasons:
>
> Locale("ja", "JP", "JP") is treated as "ja-JP-u-ca-japanese"
> ...
Without the correct compatibility extension, "JP" or "TH" are merely ill-formed
variants, so throwing should be acceptable. Is this not already adequate?
I am happy to clarify further if needed, but I was inclined to not add
documentation because this is not a common case.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/31728#issuecomment-4847645197