fix compiler warning, part 3. :-)
@@ -1218,11 +1218,10 @@ public class CVC5NativeAPITest {
@Test
public void termAccessAfterModelClosed() throws CVC5ApiException {
- Solver secondSolver = createEnvironment();
-
+ try (Solver secondSolver = createEnvironment()) {
Term v = solver.mkConst(solver.getIntegerSort(), "v");
Term one = solver.mkInteger(1);
- Term eq = solver.mkTerm(Kind.EQUAL, v, one); // x==1
+ Term eq = solver.mkTerm(Kind.EQUAL, v, one); // v==1
secondSolver.assertFormula(eq);
Result result = secondSolver.checkSat();
@@ -1230,8 +1229,7 @@ public class CVC5NativeAPITest {
Term valueV = secondSolver.getValue(v);
Preconditions.checkNotNull(valueV);
-
- secondSolver.close();
+ }
// System.out.println(valueV); // Segmentation fault, because valueX is already cleaned up.
}
