HHH-7509 fix NPE in second level cache
This commit is contained in:
parent
0068625ee7
commit
8e73bb056e
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue