Skip to content

Commit

Permalink
Remove type from ResolverMapKey
Browse files Browse the repository at this point in the history
  • Loading branch information
manofthepeace committed Oct 26, 2023
1 parent 8cb1e33 commit ffc8a2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
}
}

0 comments on commit ffc8a2a

Please sign in to comment.