mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 10:55:50 +00:00
Java bindings with no finalizers
Replacing finalizers with PhantomReferences, required quite a lot of changes to the codebase.
This commit is contained in:
parent
dfc80d3b69
commit
495ef0f055
48 changed files with 368 additions and 939 deletions
|
@ -62,19 +62,13 @@ public class Symbol extends Z3Object
|
|||
* A string representation of the symbol.
|
||||
**/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (isIntSymbol())
|
||||
return Integer.toString(((IntSymbol) this).getInt());
|
||||
else if (isStringSymbol())
|
||||
return ((StringSymbol) this).getString();
|
||||
else
|
||||
return "Z3Exception: Unknown symbol kind encountered.";
|
||||
} catch (Z3Exception ex)
|
||||
{
|
||||
return "Z3Exception: " + ex.getMessage();
|
||||
public String toString() {
|
||||
if (isIntSymbol()) {
|
||||
return Integer.toString(((IntSymbol) this).getInt());
|
||||
} else if (isStringSymbol()) {
|
||||
return ((StringSymbol) this).getString();
|
||||
} else {
|
||||
return "Z3Exception: Unknown symbol kind encountered.";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,6 +80,11 @@ public class Symbol extends Z3Object
|
|||
super(ctx, obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
void incRef(long o) {
|
||||
// Symbol does not require tracking.
|
||||
}
|
||||
|
||||
static Symbol create(Context ctx, long obj)
|
||||
{
|
||||
switch (Z3_symbol_kind.fromInt(Native.getSymbolKind(ctx.nCtx(), obj)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue