3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 17:44:08 +00:00

Java API: bugfixes

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2012-11-28 14:59:39 +00:00
parent 29b896b0bf
commit 519d308b86
2 changed files with 7 additions and 15 deletions

View file

@ -806,7 +806,6 @@ class JavaExample
{ {
System.out.println("BasicTests"); System.out.println("BasicTests");
Symbol qi = ctx.MkSymbol(1);
Symbol fname = ctx.MkSymbol("f"); Symbol fname = ctx.MkSymbol("f");
Symbol x = ctx.MkSymbol("x"); Symbol x = ctx.MkSymbol("x");
Symbol y = ctx.MkSymbol("y"); Symbol y = ctx.MkSymbol("y");
@ -2207,7 +2206,8 @@ class JavaExample
} catch (Z3Exception ex) } catch (Z3Exception ex)
{ {
System.out.println("Z3 Managed Exception: " + ex.getMessage()); System.out.println("Z3 Managed Exception: " + ex.getMessage());
System.out.println("Stack trace: " + ex.getStackTrace()); System.out.println("Stack trace: ");
ex.printStackTrace(System.out);
} catch (TestFailedException ex) } catch (TestFailedException ex)
{ {
System.out.println("TEST CASE FAILED: " + ex.getMessage()); System.out.println("TEST CASE FAILED: " + ex.getMessage());

View file

@ -2974,23 +2974,15 @@ public class Context extends IDisposable
void CheckContextMatch(Z3Object other) throws Z3Exception void CheckContextMatch(Z3Object other) throws Z3Exception
{ {
if (this != other.Context())
if (this == other.Context()) throw new Z3Exception("Context mismatch");
throw new Z3Exception("Context mismatch");
} }
void CheckContextMatch(Z3Object[] arr) throws Z3Exception void CheckContextMatch(Z3Object[] arr) throws Z3Exception
{ {
if (arr != null)
if (arr != null) for (Z3Object a : arr)
{ CheckContextMatch(a);
for (Z3Object a : arr)
{
// It was an assume, now we added the precondition, and we made
// it into an assert
CheckContextMatch(a);
}
}
} }
private ASTDecRefQueue m_AST_DRQ = new ASTDecRefQueue(); private ASTDecRefQueue m_AST_DRQ = new ASTDecRefQueue();