On Sat, 11 Jul 2026 14:44:03 GMT, Kevin Rushforth <[email protected]> wrote:
>> Nir Lisker has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Formatting fixes
>
> modules/javafx.base/src/main/java/javafx/util/converter/BaseTemporalStringConverter.java
> line 42:
>
>> 40: abstract class BaseTemporalStringConverter<T extends Temporal> extends
>> BaseStringConverter<T> {
>> 41:
>> 42: private static final Locale DEFAULT_LOCALE =
>> Locale.getDefault(Locale.Category.FORMAT);
>
> Currently, the default format Locale is read every time a converter is
> constructed. Caching it in a static final means that a change by an
> application to the default Locale after this class has been initialized will
> be ignored. If that's unintentional, then it should be fixed. If intentional,
> then it should be discussed and documented in the CSR as a (fairly minor)
> behavioral change.
I reverted the change. I didn't think the *default* locale would change during
the application's life. Does `Chronology` need to change its caching too?
There's `Chronology.ofLocale(Locale)` that can adjust to the default locale with
private static final Locale defaultLocale() {
return Locale.getDefault(Locale.Category.FORMAT);
}
private static final Chronology defaultChrono() {
return Chronology.ofLocale(defaultLocale());
}
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1880#discussion_r3565191158