DATACMNS-485 - Fixed bug in ParameterizedTypeInformation.hashCode().
Previously, ParameterizedTypeInformation.hashCode() had been inconsistent to equals in case of a fully resolved parameterized type. This is now fixed by not including the parent reference in case a parameterized type is resolved completely. Also, TypeDiscoverer.getActualType() does not return the component type for non-collection/non-maps anymore to make sure we don't accidentally unwrap parameterized types.
This commit is contained in:
@@ -181,7 +181,7 @@ class ParameterizedTypeInformation<T> extends ParentTypeAwareTypeInformation<T>
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode() + (isResolvedCompletely() ? this.type.hashCode() : 0);
|
||||
return isResolvedCompletely() ? this.type.hashCode() : super.hashCode();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -284,13 +284,7 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
||||
return getComponentType();
|
||||
}
|
||||
|
||||
List<TypeInformation<?>> arguments = getTypeArguments();
|
||||
|
||||
if (arguments.isEmpty()) {
|
||||
return this;
|
||||
}
|
||||
|
||||
return arguments.get(arguments.size() - 1);
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user