Skip to content

Commit a41550b

Browse files
committed
8283842: TestZoneTextPrinterParser.test_roundTripAtOverlap fails: DateTimeParseException
Reviewed-by: iris, rriggs, scolebourne
1 parent 207b099 commit a41550b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,15 @@ Object[][] data_roundTripAtOverlap() {
262262

263263
@Test(dataProvider="roundTripAtOverlap")
264264
public void test_roundTripAtOverlap(String pattern, String input) {
265-
var dtf = DateTimeFormatter.ofPattern(pattern);
265+
var dtf = DateTimeFormatter.ofPattern(pattern, Locale.US);
266266
assertEquals(dtf.format(ZonedDateTime.parse(input, dtf)), input);
267267
var lc = input.toLowerCase(Locale.ROOT);
268268
try {
269269
ZonedDateTime.parse(lc, dtf);
270270
fail("Should throw DateTimeParseException");
271271
} catch (DateTimeParseException ignore) {}
272272

273-
dtf = new DateTimeFormatterBuilder().parseCaseInsensitive().appendPattern(pattern).toFormatter();
273+
dtf = new DateTimeFormatterBuilder().parseCaseInsensitive().appendPattern(pattern).toFormatter(Locale.US);
274274
assertEquals(dtf.format(ZonedDateTime.parse(input, dtf)), input);
275275
assertEquals(dtf.format(ZonedDateTime.parse(lc, dtf)), input);
276276
}

0 commit comments

Comments
 (0)