3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-13 09:26:15 +00:00

Java API: bugfix

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2012-12-03 17:56:42 +00:00
parent 67485b8af7
commit eb3fa254d8

View file

@ -37,13 +37,15 @@ public class AST extends Z3Object
**/ **/
public boolean equals(Object o) public boolean equals(Object o)
{ {
AST casted = null; AST casted = null;
try { try
casted = AST.class.cast(o); {
} catch (ClassCastException e) { casted = AST.class.cast(o);
return false; } catch (ClassCastException e)
} {
return false;
}
return this.NativeObject() == casted.NativeObject(); return this.NativeObject() == casted.NativeObject();
} }
@ -60,18 +62,20 @@ public class AST extends Z3Object
return 1; return 1;
AST oAST = null; AST oAST = null;
try { try
AST.class.cast(other); {
} catch (ClassCastException e) { oAST = AST.class.cast(other);
return 1; } catch (ClassCastException e)
} {
return 1;
}
if (Id() < oAST.Id()) if (Id() < oAST.Id())
return -1; return -1;
else if (Id() > oAST.Id()) else if (Id() > oAST.Id())
return +1; return +1;
else else
return 0; return 0;
} }
/** /**