From f8650e3db5cd8021fa8d267fc98b3be4fd436eb4 Mon Sep 17 00:00:00 2001 From: John DeRegnaucourt Date: Mon, 12 Feb 2024 21:08:55 -0500 Subject: [PATCH] Fixed JDK 1.8 problem. OffsetDateTime.parse() does not handle proper ISO 8601 Date Time offset Strings that include timezone offset values: "2024-02-12T11:38:00+01:00". That fails to parse in JDK 1.8, but works in 11+ --- .../cedarsoftware/util/convert/ConverterEverythingTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java b/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java index 8b8baad4..c21ed76b 100644 --- a/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java +++ b/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java @@ -792,7 +792,7 @@ public TimeZone getTimeZone() { { new Timestamp(Long.MAX_VALUE), Long.MAX_VALUE }, }); TEST_DB.put(pair(Instant.class, Long.class), new Object[][] { - { Instant.parse("2024-02-12T11:38:00+01:00"), 1707734280000L }, + { ZonedDateTime.parse("2024-02-12T11:38:00+01:00").toInstant(), 1707734280000L }, }); TEST_DB.put(pair(LocalDate.class, Long.class), new Object[][] { { (Supplier) () -> { @@ -1041,7 +1041,7 @@ public TimeZone getTimeZone() { { (char) 0, 0d }, }); TEST_DB.put(pair(Instant.class, Double.class), new Object[][] { - { Instant.parse("2024-02-12T11:38:00+01:00"), 1707734280000d }, + { ZonedDateTime.parse("2024-02-12T11:38:00+01:00").toInstant(), 1707734280000d }, }); TEST_DB.put(pair(LocalDate.class, Double.class), new Object[][] { { (Supplier) () -> {