HHH-7509 fix NPE in second level cache

This commit is contained in:
Scott Marlow 2012-08-08 21:46:54 -04:00
parent e53c808542
commit 15cc02be33
2 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ public boolean equals(Object other) {
if ( this == other ) { if ( this == other ) {
return true; 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 //hashCode is part of this check since it is pre-calculated and hash must match for equals to be true
return false; return false;
} }

View File

@ -141,7 +141,7 @@ public boolean equals(Object o) {
return true; 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 //hashCode is part of this check since it is pre-calculated and hash must match for equals to be true
return false; return false;
} }