boolean (List<ToStringCommand> requests, EvaluationContext evaluationContext) { try { if (!hasBatchEvaluator(evaluationContext)) { return false; } DebugProcess debugProcess = evaluationContext.getDebugProcess(); List<Value> values = ContainerUtil.map(requests, ToStringCommand::getValue); ArrayType objectArrayClass = (ArrayType)debugProcess.findClass( evaluationContext, "java.lang.Object[]", evaluationContext.getClassLoader()); if (objectArrayClass == null) { return false; } ArrayReference argArray = DebuggerUtilsEx.mirrorOfArray(objectArrayClass, values.size(), evaluationContext); DebuggerUtilsEx.setValuesNoCheck(argArray, values); String value = DebuggerUtils.processCollectibleValue( () -> ((DebugProcessImpl)debugProcess).invokeMethod( evaluationContext, myBatchEvaluatorClass, myBatchEvaluatorMethod, Collections.singletonList(argArray), MethodImpl.SKIP_ASSIGNABLE_CHECK, true), result -> result instanceof StringReference ? ((StringReference)result).value() : null ); if (value != null) { byte[] bytes = value.getBytes(StandardCharsets.ISO_8859_1); try (DataInputStream dis = new DataInputStream(new ByteArrayInputStream(bytes))) { int count = 0; while (dis.available() > 0) { boolean error = dis.readBoolean(); String message = dis.readUTF(); if (count >= requests.size()) { LOG.error("Invalid number of results: required " + requests.size() + ", reply = " + Arrays.toString(bytes)); return false; } ToStringCommand command = requests.get(count++); if (error) { command.evaluationError(JavaDebuggerBundle.message("evaluation.error.method.exception", message)); } else { command.evaluationResult(message); } } } catch (IOException e) { LOG.error("Failed to read batch response", e, "reply was " + Arrays.toString(bytes)); return false; } return true; } } catch (ClassNotLoadedException | ObjectCollectedException | EvaluateException | InvalidTypeException e) { LOG.debug(e); } return false; }