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 ) {
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue