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 class CacheKey implements Serializable {
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;
}

View File

@ -141,7 +141,7 @@ public class NaturalIdCacheKey implements Serializable {
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;
}