Пример #1
0
  // avoids node.list() call if there is exactly 1 include with a literal head
  private List<? extends Node> list(Node node, List<Object[]> includes) throws IOException {
    Node child;

    if (includes.size() == 1 && includes.get(0)[0] instanceof String) {
      child = node.join((String) includes.get(0)[0]);
      if (child.exists()) {
        return Collections.singletonList(child);
      } else {
        return Collections.emptyList();
      }
    } else {
      return node.list();
    }
  }