Prevent StackOverflowError in AbstractJackson2HttpMessageConverter

Issue: SPR-14520
This commit is contained in:
Sebastien Deleuze
2016-08-04 11:11:15 -07:00
parent 14ae8be547
commit 7c5050cf80
2 changed files with 35 additions and 3 deletions

View File

@@ -356,9 +356,13 @@ public abstract class AbstractJackson2HttpMessageConverter extends AbstractGener
return resolvedType;
}
}
resolvedType = resolveVariable(typeVariable, contextType.getSuperType());
if (resolvedType.resolve() != null) {
return resolvedType;
ResolvableType superType = contextType.getSuperType();
if (superType != ResolvableType.NONE) {
resolvedType = resolveVariable(typeVariable, superType);
if (resolvedType.resolve() != null) {
return resolvedType;
}
}
for (ResolvableType ifc : contextType.getInterfaces()) {
resolvedType = resolveVariable(typeVariable, ifc);