RFR: 8326948: Force English locale for timeout formatting
Andy Goryachev
angorya at openjdk.org
Wed Feb 28 15:50:52 UTC 2024
On Wed, 28 Feb 2024 12:20:04 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
> If a test runs in non-English locale, the digits displayed in the timeout could be locale-specific, which may be confusing.
>
> For example, in the Arabic locale `-Duser.language=ar`, the timeout is displayed like this:
>
> Test timeout: ٠٠:٠٤:٥٨
>
> The fix explicitly sets English locale for formatting, which ensures the timeout is always displayed with the Western Arabic numerals, see [Numerals in most popular systems](https://en.wikipedia.org/wiki/Numerical_digit#Numerals_in_most_popular_systems).
test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 644:
> 642: long seconds = (leftTime - hours * 3_600_000 - minutes * 60_000) / 1_000;
> 643: label.setText(String.format(Locale.ENGLISH,
> 644: "Test timeout: %02d:%02d:%02d",
is this the only place where we must enforce the locale? Surely, there must be many, many other occurrences!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18042#discussion_r1506180948
More information about the client-libs-dev
mailing list