Permalink
Browse files

HHH-7509 fix NPE in second level cache

  • Loading branch information...
1 parent 0068625 commit 8e73bb056e8f3d52eced1ddf22c2d8c58a4d8261 @scottmarlow scottmarlow committed Aug 9, 2012
@@ -90,7 +90,7 @@ public boolean equals(Object other) {
if ( this == other ) {
return true;
}
- if ( hashCode != other.hashCode() || !(other instanceof CacheKey) ) {
+ if ( !(other instanceof CacheKey) || hashCode != other.hashCode()) {
//hashCode is part of this check since it is pre-calculated and hash must match for equals to be true
return false;
}
@@ -141,7 +141,7 @@ public boolean equals(Object o) {
return true;
}
- if ( hashCode != o.hashCode() || !(o instanceof NaturalIdCacheKey) ) {
+ if ( !(o instanceof NaturalIdCacheKey) || hashCode != o.hashCode() ) {
//hashCode is part of this check since it is pre-calculated and hash must match for equals to be true
return false;
}

0 comments on commit 8e73bb0

Please sign in to comment.