HHH-7509 fix NPE in second level cache

This commit is contained in:
Scott Marlow 2012-08-08 21:46:54 -04:00
parent 0068625ee7
commit 8e73bb056e
2 changed files with 2 additions and 2 deletions

View File

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