From 79bc2ab2cfce40cef00fc11d3749da6bee852937 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Thu, 27 Oct 2022 21:12:04 +0900 Subject: [PATCH 1/3] Upgrade GSON and other optional dependencies --- bolt-http4k/pom.xml | 2 +- bolt-kotlin-examples/pom.xml | 2 +- bolt-micronaut/pom.xml | 4 ++-- bolt-quarkus-examples/pom.xml | 7 ++++++- bolt-spring-boot-examples/pom.xml | 4 ++-- docs/_config.yml | 2 +- pom.xml | 3 ++- slack-api-client/pom.xml | 2 +- 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/bolt-http4k/pom.xml b/bolt-http4k/pom.xml index bf4517bc2..3c129aab4 100644 --- a/bolt-http4k/pom.xml +++ b/bolt-http4k/pom.xml @@ -10,7 +10,7 @@ - 4.32.2.0 + 4.33.1.0 bolt-http4k diff --git a/bolt-kotlin-examples/pom.xml b/bolt-kotlin-examples/pom.xml index fec9a6e9a..83d0573e4 100644 --- a/bolt-kotlin-examples/pom.xml +++ b/bolt-kotlin-examples/pom.xml @@ -54,7 +54,7 @@ ch.qos.logback logback-classic - ${logback.version} + ${logback-slf4j-v2.version} diff --git a/bolt-micronaut/pom.xml b/bolt-micronaut/pom.xml index 51e1af958..1458254d2 100644 --- a/bolt-micronaut/pom.xml +++ b/bolt-micronaut/pom.xml @@ -10,8 +10,8 @@ - 3.7.1 - 3.5.0 + 3.7.2 + 3.7.0 2.3.0 5.9.1 diff --git a/bolt-quarkus-examples/pom.xml b/bolt-quarkus-examples/pom.xml index 7637322ff..4b91e8139 100644 --- a/bolt-quarkus-examples/pom.xml +++ b/bolt-quarkus-examples/pom.xml @@ -19,7 +19,7 @@ UTF-8 quarkus-bom io.quarkus.platform - 2.12.0.Final + 2.13.3.Final 1.6.0 3.8.1 @@ -74,6 +74,11 @@ quarkus-undertow ${quarkus.platform.version} + + ch.qos.logback + logback-classic + ${logback-slf4j-v2.version} + diff --git a/bolt-spring-boot-examples/pom.xml b/bolt-spring-boot-examples/pom.xml index a439f7e9c..7a9d4922b 100644 --- a/bolt-spring-boot-examples/pom.xml +++ b/bolt-spring-boot-examples/pom.xml @@ -10,7 +10,7 @@ - 2.7.4 + 2.7.5 bolt-spring-boot-examples @@ -44,7 +44,7 @@ ch.qos.logback logback-classic - ${logback.version} + ${logback-slf4j-v2.version} org.springframework.boot diff --git a/docs/_config.yml b/docs/_config.yml index adc84bb01..4c219b834 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -10,7 +10,7 @@ sdkLatestVersion: 1.26.1 okhttpVersion: 4.10.0 slf4jApiVersion: 1.7.36 kotlinVersion: 1.7.20 -springBootVersion: 2.7.4 +springBootVersion: 2.7.5 compatibleMicronautVersion: 3.x quarkusVersion: 2.12.0.Final helidonVersion: 2.5.0 diff --git a/pom.xml b/pom.xml index c11ecdda4..1f34a08c2 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 5.0.0 4.10.0 - 2.9.1 + 2.10 1.7.20 1.19 1.5.3 - 4.2.3 + 4.3.1 1.0.4 From 6e244fb6256d6c63f84c8b08e15b82a3e3f664cd Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 7 Nov 2022 13:15:04 +0900 Subject: [PATCH 2/3] Upgrade optional dependencies --- bolt-http4k/pom.xml | 2 +- bolt-ktor/pom.xml | 2 +- bolt-micronaut/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bolt-http4k/pom.xml b/bolt-http4k/pom.xml index 3c129aab4..43da1d625 100644 --- a/bolt-http4k/pom.xml +++ b/bolt-http4k/pom.xml @@ -10,7 +10,7 @@ - 4.33.1.0 + 4.33.3.0 bolt-http4k diff --git a/bolt-ktor/pom.xml b/bolt-ktor/pom.xml index 168ef177d..5548c5351 100644 --- a/bolt-ktor/pom.xml +++ b/bolt-ktor/pom.xml @@ -15,7 +15,7 @@ UTF-8 official - 2.1.2 + 2.1.3 diff --git a/bolt-micronaut/pom.xml b/bolt-micronaut/pom.xml index 1458254d2..43823607d 100644 --- a/bolt-micronaut/pom.xml +++ b/bolt-micronaut/pom.xml @@ -10,7 +10,7 @@ - 3.7.2 + 3.7.3 3.7.0 2.3.0 5.9.1 From 1168b93a93dbb564c4bf4903cdc1fa5fdbc5f20c Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Mon, 7 Nov 2022 13:55:42 +0900 Subject: [PATCH 3/3] Fix UnknownPropertyDetectionAdapterFactory errors --- .../methods/files_remote_Test.java | 2 +- ...nknownPropertyDetectionAdapterFactory.java | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/slack-api-client/src/test/java/test_with_remote_apis/methods/files_remote_Test.java b/slack-api-client/src/test/java/test_with_remote_apis/methods/files_remote_Test.java index a924f3f22..2a4661c96 100644 --- a/slack-api-client/src/test/java/test_with_remote_apis/methods/files_remote_Test.java +++ b/slack-api-client/src/test/java/test_with_remote_apis/methods/files_remote_Test.java @@ -232,7 +232,7 @@ public void updateAndShare_searchable() throws Exception { boolean found = false; String query = externalId + ": Seamlessly start a voice call"; long millis = 0; - while (!found && millis < 30 * 1000) { + while (!found && millis < 60 * 1000) { Thread.sleep(500); millis += 500; SearchFilesResponse searchResults = slack.methods(userToken).searchFiles(r -> r.query(query)); diff --git a/slack-api-model/src/main/java/com/slack/api/util/json/UnknownPropertyDetectionAdapterFactory.java b/slack-api-model/src/main/java/com/slack/api/util/json/UnknownPropertyDetectionAdapterFactory.java index 7bda6313f..80dd06212 100644 --- a/slack-api-model/src/main/java/com/slack/api/util/json/UnknownPropertyDetectionAdapterFactory.java +++ b/slack-api-model/src/main/java/com/slack/api/util/json/UnknownPropertyDetectionAdapterFactory.java @@ -28,9 +28,24 @@ public TypeAdapter create(Gson gson, TypeToken type) { try { // Get reference to the existing boundFields. - Field f = delegate.getClass().getDeclaredField("boundFields"); - f.setAccessible(true); - Map boundFields = (Map) f.get(delegate); + Class adaptorClass = delegate.getClass(); + Field boundFieldsField = null; + while (boundFieldsField == null && !adaptorClass.equals(Object.class)) { + try { + boundFieldsField = adaptorClass.getDeclaredField("boundFields"); + } catch (NoSuchFieldException _ignore) { + // Since GSON v3.10, the internal class hierarchy has been changed + // 1) com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter + // 2) com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter + adaptorClass = adaptorClass.getSuperclass(); + } + } + if (boundFieldsField == null) { + String message = "Failed to find bound fields inside GSON"; + throw new IllegalStateException(message); + } + boundFieldsField.setAccessible(true); + Map boundFields = (Map) boundFieldsField.get(delegate); StringBuilder sb = new StringBuilder(); for (Object key : boundFields.keySet()) { sb.append(key + ", "); @@ -53,7 +68,7 @@ public Object get(Object key) { }; // Finally, push our custom map back using reflection. - f.set(delegate, boundFields); + boundFieldsField.set(delegate, boundFields); } catch (Exception e) { // Should never happen if the implementation doesn't change.