From ffc8a2a15c8701946d389b8abe0ff663b30e43b5 Mon Sep 17 00:00:00 2001 From: Alex Martel <13215031+manofthepeace@users.noreply.github.com> Date: Thu, 26 Oct 2023 09:27:14 -0400 Subject: [PATCH] Remove type from ResolverMapKey --- .../jackson/runtime/serialisers/JacksonUtil.java | 4 ++-- .../jackson/runtime/serialisers/ResolverMapKey.java | 13 +++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/java/io/quarkus/rest/client/reactive/jackson/runtime/serialisers/JacksonUtil.java b/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/java/io/quarkus/rest/client/reactive/jackson/runtime/serialisers/JacksonUtil.java index bb8c217f4ac35..594f4b04a02be 100644 --- a/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/java/io/quarkus/rest/client/reactive/jackson/runtime/serialisers/JacksonUtil.java +++ b/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/java/io/quarkus/rest/client/reactive/jackson/runtime/serialisers/JacksonUtil.java @@ -31,11 +31,11 @@ static ObjectMapper getObjectMapperFromContext(Class type, MediaType response } if (contextResolver != null) { var cr = contextResolver; - var key = new ResolverMapKey(type, context.getConfiguration(), context.getInvokedMethod().getDeclaringClass()); + var key = new ResolverMapKey(context.getConfiguration(), context.getInvokedMethod().getDeclaringClass()); return contextResolverMap.computeIfAbsent(key, new Function<>() { @Override public ObjectMapper apply(ResolverMapKey resolverMapKey) { - return cr.getContext(resolverMapKey.getType()); + return cr.getContext(resolverMapKey.getRestClientClass()); } }); } diff --git a/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/java/io/quarkus/rest/client/reactive/jackson/runtime/serialisers/ResolverMapKey.java b/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/java/io/quarkus/rest/client/reactive/jackson/runtime/serialisers/ResolverMapKey.java index 02b8148f06b40..3e4ba6c3dd64c 100644 --- a/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/java/io/quarkus/rest/client/reactive/jackson/runtime/serialisers/ResolverMapKey.java +++ b/extensions/resteasy-reactive/rest-client-reactive-jackson/runtime/src/main/java/io/quarkus/rest/client/reactive/jackson/runtime/serialisers/ResolverMapKey.java @@ -10,21 +10,14 @@ */ public final class ResolverMapKey { - private final Class type; private final Configuration configuration; - private final Class restClientClass; - public ResolverMapKey(Class type, Configuration configuration, Class restClientClass) { - this.type = type; + public ResolverMapKey(Configuration configuration, Class restClientClass) { this.configuration = configuration; this.restClientClass = restClientClass; } - public Class getType() { - return type; - } - public Configuration getConfiguration() { return configuration; } @@ -42,12 +35,12 @@ public boolean equals(Object o) { return false; } ResolverMapKey that = (ResolverMapKey) o; - return Objects.equals(type, that.type) && Objects.equals(configuration, that.configuration) + return Objects.equals(configuration, that.configuration) && Objects.equals(restClientClass, that.restClientClass); } @Override public int hashCode() { - return Objects.hash(type, configuration, restClientClass); + return Objects.hash(configuration, restClientClass); } }