3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

Proper idiomatic isEquals implementation.

This commit is contained in:
George Karpenkov 2016-01-06 10:24:00 +01:00
parent 92bb984305
commit 56db1867ef

View file

@ -49,17 +49,14 @@ public class Symbol extends Z3Object
return getKind() == Z3_symbol_kind.Z3_STRING_SYMBOL;
}
@Override
public boolean equals(Object o)
{
Symbol casted = null;
try {
casted = Symbol.class.cast(o);
}
catch (ClassCastException e) {
return false;
}
return this.getNativeObject() == casted.getNativeObject();
if (o == null) return false;
if (o == this) return true;
if (o.getClass() != this.getClass()) return false;
Symbol other = (Symbol) o;
return this.getNativeObject() == other.getNativeObject();
}
/**