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