support null in batch toString

GitOrigin-RevId: 7cac9db8e0a5db53c8ce0d9032578d7824b2e37d
This commit is contained in:
Egor Ushakov
2020-04-08 19:46:58 +03:00
committed by intellij-monorepo-bot
parent 00f6093164
commit ece9437fd8
2 changed files with 9 additions and 4 deletions

View File

@@ -14,11 +14,14 @@ public class BatchEvaluatorServer {
*/
public static String evaluate(Object[] objects) throws IOException {
ByteArrayOutputStream bas = new ByteArrayOutputStream();
for (int idx = 0; idx < objects.length; idx++) {
for (Object object : objects) {
String res;
int length;
try {
res = objects[idx].toString();
res = object.toString();
if (res == null) {
res = "null";
}
length = res.length();
}
catch (Throwable e) {