From 4ea7f6088e5c58e8097f88a59229d91f1ca9d13c Mon Sep 17 00:00:00 2001 From: jbrugge Date: Sat, 21 Dec 2024 02:50:01 -0600 Subject: [PATCH] [Java] Avoid ambiguous references for date and time classes (#18416) (#20230) --- modules/openapi-generator/src/main/resources/Java/JSON.mustache | 2 ++ .../resources/Java/libraries/okhttp-gson/ApiClient.mustache | 2 ++ .../src/main/resources/Java/libraries/okhttp-gson/JSON.mustache | 2 ++ .../main/resources/Java/libraries/retrofit2/ApiClient.mustache | 2 ++ .../src/main/resources/Java/libraries/retrofit2/JSON.mustache | 2 ++ 5 files changed, 10 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/JSON.mustache index 1d0a8138787b..5ef02660d746 100644 --- a/modules/openapi-generator/src/main/resources/Java/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/JSON.mustache @@ -31,9 +31,11 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +{{#jsr310}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +{{/jsr310}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index ef6e35600998..519b37ed2eca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -47,9 +47,11 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; +{{#jsr310}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +{{/jsr310}} import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache index 6cf7ec7898c4..eee7773c4cc0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/JSON.mustache @@ -28,9 +28,11 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +{{#jsr310}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +{{/jsr310}} import java.util.Date; import java.util.Locale; import java.util.Map; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index 077e8d6924b9..c05159d4e0a0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -46,7 +46,9 @@ import java.io.IOException; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; +{{#jsr310}} import java.time.format.DateTimeFormatter; +{{/jsr310}} import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache index 2ff8b1cb739c..2e986485fcd8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/JSON.mustache @@ -30,9 +30,11 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; +{{#jsr310}} import java.time.LocalDate; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; +{{/jsr310}} import java.util.Date; import java.util.Locale; import java.util.Map;