Skip to content

Commit

Permalink
GEODE-9632: hashcode update
Browse files Browse the repository at this point in the history
  • Loading branch information
mivanac committed Jul 17, 2022
1 parent 1f98bff commit 1b4824f
Showing 1 changed file with 3 additions and 18 deletions.
Expand Up @@ -14,6 +14,8 @@
*/
package org.apache.geode.cache.query.internal.index;

import static java.util.Objects.hash;

import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
Expand Down Expand Up @@ -907,24 +909,7 @@ public boolean equals(Object obj) {

@Override
public int hashCode() {
int keyhashcode = 0;
int valuehashcode = 0;
if (getKey() != null) {
keyhashcode = getKey().hashCode();
}
if (getValue() != null) {
valuehashcode = 31 * getValue().hashCode();
}

if (keyhashcode == 0) {
return valuehashcode;
}

if (valuehashcode == 0) {
return keyhashcode;
}

return keyhashcode ^ valuehashcode;
return hash(key, value);
}

}
Expand Down

0 comments on commit 1b4824f

Please sign in to comment.