Integrated: 8372609: Bug4944439 does not enforce locale correctly
Justin Lu
jlu at openjdk.org
Mon Dec 1 18:20:15 UTC 2025
On Wed, 26 Nov 2025 18:35:40 GMT, Justin Lu <jlu at openjdk.org> wrote:
> This PR fixes a test bug where a `DecimalFormat` is instantiated in a static field (with the current default locale) before the test updates the system default to `Locale.US`. As a result, it may fail under various other locales, since a `Locale.US` configured `DecimalFormat` is not actually retrieved and the test expects one.
>
> In general, the preservation and restoring of the system locale is an obsolete process. The test is instead updated to just retrieve a `DecimalFormat` using a locale accepting factory method.
>
> I have manually confirmed that the tests passes with `-Duser.language=en -Duser.country=NL` on my machine, (which is the locale used in the reproducer).
This pull request has now been integrated.
Changeset: 45c0600d
Author: Justin Lu <jlu at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/45c0600d3abfa4bcd0338840523c0df69283afe2
Stats: 21 lines in 1 file changed: 0 ins; 17 del; 4 mod
8372609: Bug4944439 does not enforce locale correctly
Reviewed-by: liach, jpai
-------------
PR: https://git.openjdk.org/jdk/pull/28514
More information about the core-libs-dev
mailing list