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:
parent
92bb984305
commit
56db1867ef
1 changed files with 6 additions and 9 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue