diff --git a/client/src/com/aerospike/client/Value.java b/client/src/com/aerospike/client/Value.java index 0dc598846..b79423a4e 100644 --- a/client/src/com/aerospike/client/Value.java +++ b/client/src/com/aerospike/client/Value.java @@ -817,9 +817,13 @@ public String toString() { @Override public boolean equals(Object other) { - return (other != null && - this.getClass().equals(other.getClass()) && - this.value == ((ShortValue)other).value); + if (this == other) { + return true; + } + if (other == null || other.getClass() != ShortValue.class) { + return false; + } + return this.value == ((ShortValue) other).value; } @Override