alagodasii commented on code in PR #2113: URL: https://github.com/apache/jackrabbit-oak/pull/2113#discussion_r1973184799
########## oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/Aggregate.java: ########## @@ -588,37 +588,36 @@ public Matcher match(String name, NodeState nodeState) { } } - public Collection<Matcher> nextSet() { + public List<Matcher> nextSet() { checkArgument(status != Status.FAIL); - if (status == Status.MATCH_FOUND){ + if (status == Status.MATCH_FOUND) { Aggregate nextAgg = currentInclude.getAggregate(matchedNodeState); - if (nextAgg != null){ + if (nextAgg != null) { int recursionLevel = aggregateStack.size() + 1; - if (recursionLevel >= rootState.rootAggregate.reAggregationLimit){ - return Collections.emptyList(); + if (recursionLevel >= rootState.rootAggregate.reAggregationLimit) { + return List.of(); } List<Matcher> result = new ArrayList<>(nextAgg.includes.size()); - for (Include i : nextAgg.includes){ - result.add(new Matcher(this, i, currentPath)); + for (Include i : nextAgg.includes) { + result.add(new Matcher(this, i, currentPath)); } return result; } - return Collections.emptyList(); + return List.of(); Review Comment: Actually, what's the benefit of using `List.of()` in comparison to `emptyList()`? Both create immutable lists without elements. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org