Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

HHH-7509 fix NPE in second level cache

  • Loading branch information...
commit 8e73bb056e8f3d52eced1ddf22c2d8c58a4d8261 1 parent 0068625
@scottmarlow scottmarlow authored
View
2  hibernate-core/src/main/java/org/hibernate/cache/spi/CacheKey.java
@@ -90,7 +90,7 @@ public boolean equals(Object other) {
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
2  hibernate-core/src/main/java/org/hibernate/cache/spi/NaturalIdCacheKey.java
@@ -141,7 +141,7 @@ public boolean equals(Object o) {
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.