@Override public void consume(Message message) throws MessageIssueException, JsonRpcException { List<MessageIssue> result = new ArrayList<>(); try { validate(message, result, new LinkedList<>(), new LinkedList<>()); } catch (Exception e) { LOG.log(Level.SEVERE, "Error during message validation: " + e.getMessage(), e); result.add(new MessageIssue("Message validation failed, please check the logs of the remote endpoint.", ResponseErrorCode.InvalidParams.getValue())); } if (!result.isEmpty()) { // Sort the messages in order to get a stable order (otherwise it depends on the JVM's reflection implementation) Collections.sort(result, (issue1, issue2) -> issue1.getText().compareTo(issue2.getText())); throw new MessageIssueException(message, result); } else if (delegate != null) { delegate.consume(message); } }
@Override public void consume(Message message) throws MessageIssueException, JsonRpcException { List<MessageIssue> result = new ArrayList<>(); try { validate(message, result, new LinkedList<>(), new LinkedList<>()); } catch (Exception e) { LOG.log(Level.SEVERE, "Error during message validation: " + e.getMessage(), e); result.add(new MessageIssue("Message validation failed, please check the logs of the remote endpoint.", ResponseErrorCode.InvalidParams.getValue())); } if (!result.isEmpty()) { // Sort the messages in order to get a stable order (otherwise it depends on the JVM's reflection implementation) Collections.sort(result, (issue1, issue2) -> issue1.getText().compareTo(issue2.getText())); throw new MessageIssueException(message, result); } else if (delegate != null) { delegate.consume(message); } }
ResponseErrorCode.InvalidParams.getValue())); validate(element, issues, objectStack, accessorStack); accessorStack.pop(); Either<?, ?> either = (Either<?, ?>) object; if (either.isLeft()) { validate(either.getLeft(), issues, objectStack, accessorStack); } else if (either.isRight()) { validate(either.getRight(), issues, objectStack, accessorStack); } else { issues.add(new MessageIssue("An Either instance must not be empty." ResponseErrorCode.InvalidParams.getValue())); validate(value, issues, objectStack, accessorStack); accessorStack.pop();
ResponseErrorCode.InvalidParams.getValue())); validate(element, issues, objectStack, accessorStack); accessorStack.pop(); Either<?, ?> either = (Either<?, ?>) object; if (either.isLeft()) { validate(either.getLeft(), issues, objectStack, accessorStack); } else if (either.isRight()) { validate(either.getRight(), issues, objectStack, accessorStack); } else { issues.add(new MessageIssue("An Either instance must not be empty." ResponseErrorCode.InvalidParams.getValue())); validate(value, issues, objectStack, accessorStack); accessorStack.pop();