fix: avoid eager String-creation in precondition check.
@@ -306,7 +306,7 @@ public final class SmtInterpolSolverContext extends AbstractSolverContext {
checkArgument(
keyValue.length == 2,
"expected key-value-pair, but found an unexpected structure: %s",
- Arrays.deepToString(keyValue));
+ lazyDeepToString(keyValue));
flatten(builder, prefix + keyValue[0], keyValue[1]);
}
} else {
@@ -314,6 +314,15 @@ public final class SmtInterpolSolverContext extends AbstractSolverContext {
}
}
+ private static Object lazyDeepToString(Object[] value) {
+ return new Object() {
+ @Override
+ public String toString() {
+ return Arrays.deepToString(value);
+ }
+ };
+ }
+
@Override
public void close() {}
