<i18n dev> RFR: 8342582: user.region for formatting number no longer works for 21.0.5

Justin Lu jlu at openjdk.org
Tue Oct 22 21:24:05 UTC 2024


On Tue, 22 Oct 2024 18:09:57 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> This is a regression caused by the fix to [JDK-8321206](https://bugs.openjdk.org/browse/JDK-8321206), where the default locale with `user.region` creation is inadvertently broken. Fix is to restore the user.region override within StaticProperty initialization.

Looks correct. `initDefault(Locale.Category category)` pulls the _country/variant_format/display_ values directly from `StaticProperty`, so the _user.region_ override is getting ignored if it exists because only `initDefault()` is reading it.
I think ideally the logic could stay in `Locale`, but since the fallback of _country/variant_format/display_ `StaticProperty` is based on region, it makes sense to move the logic to when the fallback is set.

test/jdk/java/util/Locale/UserRegionTest.java line 31:

> 29:  * @modules jdk.localedata
> 30:  * @run junit/othervm
> 31:  *      -Duser.region=DE_POSIX

It might be nice to check the logic for all 3 cases: `country`, `country_variant`, or` _variant`.

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

Marked as reviewed by jlu (Committer).

PR Review: https://git.openjdk.org/jdk/pull/21645#pullrequestreview-2386404393
PR Review Comment: https://git.openjdk.org/jdk/pull/21645#discussion_r1811456591


More information about the i18n-dev mailing list