3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +00:00

Java API: split incRef into incRef and addToReferenceQueue

One method should do one thing only, it's easy to mix things up
otherwise.
This commit is contained in:
George Karpenkov 2016-06-12 21:01:58 +02:00
parent 2a347f04bf
commit 22ffd65d1e
20 changed files with 150 additions and 87 deletions

View file

@ -25,8 +25,7 @@ package com.microsoft.z3;
* also be obtained using the command {@code (help-tactic)} in the SMT 2.0
* front-end.
**/
public class Probe extends Z3Object
{
public class Probe extends Z3Object {
/**
* Execute the probe over the goal.
*
@ -46,15 +45,17 @@ public class Probe extends Z3Object
super(ctx, obj);
}
Probe(Context ctx, String name)
{
Probe(Context ctx, String name) {
super(ctx, Native.mkProbe(ctx.nCtx(), name));
}
@Override
void incRef(long o)
{
Native.probeIncRef(getContext().nCtx(), o);
void incRef() {
Native.probeIncRef(getContext().nCtx(), getNativeObject());
}
@Override
void addToReferenceQueue() {
getContext().getProbeDRQ().storeReference(getContext(), this);
}
}