On Fri, 18 Nov 2022 16:00:33 GMT, Marius Hanl <mh...@openjdk.org> wrote:

>> The change moves Locale setting in the test to `@BeforeClass` and 
>> `@AfterClass` calls. `@BeforeClass` method call stores current default VM 
>> locale and applies Locale.US, while `@AfterClass` method restores old VM 
>> locale after all tests are completed.
>> 
>> I tested it both on Mac and Windows, in both cases Locale is changed, 
>> restored properly and tests pass.
>
> modules/javafx.base/src/test/java/test/javafx/util/converter/LocalDateTimeStringConverterTest.java
>  line 60:
> 
>> 58:     private static final DateTimeFormatter aFormatter = 
>> DateTimeFormatter.ofPattern("dd MM yyyy HH mm ss");
>> 59:     private static final DateTimeFormatter aParser = 
>> DateTimeFormatter.ofPattern("yyyy MM dd hh mm ss a");
>> 60:     private static Locale oldLocale;
> 
> Isn't the creation of the DateTimeFormatter using the default locale? If so, 
> this should probably be done after the locale is set.

This is a good point. Moving the initialization of those two fields to the 
`setupBeforeAll` method seems safest.

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

PR: https://git.openjdk.org/jfx/pull/954

Reply via email to