On Tue, 22 Oct 2024 18:09:57 GMT, Naoto Sato <na...@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

Reply via email to