Fix StackOverflowError in TypeDiscoverer comparison.
We now resort to String-based comparison if a generic cannot be resolved. Previously, unresolved generics caused an infinite recursion. Closes #3084
This commit is contained in:
@@ -331,6 +331,12 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
return false;
|
||||
}
|
||||
|
||||
// in case types cannot be resolved resort to toString checking to avoid infinite recursion caused by raw types and
|
||||
// self-referencing generics
|
||||
if (that.resolvableType.hasUnresolvableGenerics() || this.resolvableType.hasUnresolvableGenerics()) {
|
||||
return ObjectUtils.nullSafeEquals(that.resolvableType.toString(), this.resolvableType.toString());
|
||||
}
|
||||
|
||||
return ObjectUtils.nullSafeEquals(resolvedGenerics.get(), that.resolvedGenerics.get());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user