Commit b1e90fdc authored by Phillip Webb's avatar Phillip Webb

Merge pull request #16974 from izeye

* pr/16974:
  Use actual resolvedType when checking Binder cache
parents 2c364ceb e2f69d04
......@@ -192,12 +192,12 @@ class JavaBeanBinder implements BeanBinder {
});
}
private boolean isOfDifferentType(ResolvableType targetType) {
private boolean isOfDifferentType(ResolvableType targetType,
Class<?> resolvedType) {
if (this.type.hasGenerics() || targetType.hasGenerics()) {
return !this.type.equals(targetType);
}
return this.resolvedType == null
|| !this.resolvedType.equals(targetType.resolve());
return this.resolvedType == null || !this.resolvedType.equals(resolvedType);
}
@SuppressWarnings("unchecked")
......@@ -214,7 +214,7 @@ class JavaBeanBinder implements BeanBinder {
return null;
}
Bean<?> bean = Bean.cached;
if (bean == null || bean.isOfDifferentType(type)) {
if (bean == null || bean.isOfDifferentType(type, resolvedType)) {
bean = new Bean<>(type, resolvedType);
cached = bean;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment