Skip to content

Commit

Permalink
DATACMNS-276 - Added hashCode() to ParameterizedTypeInformation.
Browse files Browse the repository at this point in the history
Implemented hashCode() to be as close as possible to the equals(…) implementation.
  • Loading branch information
odrotbohm committed Jan 29, 2013
1 parent 5266a9a commit 3e2ae83
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -163,6 +163,15 @@ public boolean equals(Object obj) {
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();
Expand Down

0 comments on commit 3e2ae83

Please sign in to comment.