Queue<UExpression> (@NotNull UExpression body, @NotNull UElement context) { Queue<UExpression> direct = new ArrayDeque<>(); if (body instanceof UBlockExpression) { body.accept(new AbstractUastVisitor() { @Override public boolean visitReturnExpression(@NotNull UReturnExpression node) { if (context.equals(node.getJumpTarget())) { ContainerUtil.addIfNotNull(direct, node.getReturnExpression()); } return true; } }); } else if (body instanceof UReturnExpression) { direct.add(((UReturnExpression)body).getReturnExpression()); } return direct; }