DATACMNS-276 - Added hashCode() to ParameterizedTypeInformation.

Implemented hashCode() to be as close as possible to the equals(…) implementation.
This commit is contained in:
Oliver Gierke
2013-01-29 11:19:52 +01:00
parent f18055a4c9
commit 6b49eb4ca5

View File

@@ -163,6 +163,15 @@ class ParameterizedTypeInformation<T> extends ParentTypeAwareTypeInformation<T>
return super.equals(obj);
}
/*
* (non-Javadoc)
* @see org.springframework.data.util.ParentTypeAwareTypeInformation#hashCode()
*/
@Override
public int hashCode() {
return super.hashCode() + (isResolvedCompletely() ? this.type.hashCode() : 0);
}
private boolean isResolvedCompletely() {
Type[] types = type.getActualTypeArguments();