mirror of
https://github.com/Z3Prover/z3
synced 2025-05-11 09:44:43 +00:00
Consistent #equals() implementation
Also dropped #hashCode(), as it just calls the parent class implementation.
This commit is contained in:
parent
1dcaddbec7
commit
4d3675cb4e
2 changed files with 17 additions and 35 deletions
|
@ -28,24 +28,17 @@ public class AST extends Z3Object implements Comparable<AST>
|
|||
* Object comparison.
|
||||
*
|
||||
* @param o another AST
|
||||
**/
|
||||
**/
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
AST casted = null;
|
||||
if (o == null) return false;
|
||||
if (o == this) return true;
|
||||
if (o.getClass() != this.getClass()) return false;
|
||||
AST casted = (AST) o;
|
||||
|
||||
try
|
||||
{
|
||||
casted = AST.class.cast(o);
|
||||
} catch (ClassCastException e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return (this == casted) ||
|
||||
(this != null) &&
|
||||
(casted != null) &&
|
||||
(getContext().nCtx() == casted.getContext().nCtx()) &&
|
||||
return
|
||||
(getContext().nCtx() == casted.getContext().nCtx()) &&
|
||||
(Native.isEqAst(getContext().nCtx(), getNativeObject(), casted.getNativeObject()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue