Skip to content

Commit 634bc38

Browse files
committed
upd
1 parent 330ba8f commit 634bc38

File tree

2 files changed

+7
-7
lines changed
  • x-pack/plugin
    • esql-core/src/main/java/org/elasticsearch/xpack/esql/core/tree
    • esql/src/main/java/org/elasticsearch/xpack/esql/plan

2 files changed

+7
-7
lines changed

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/tree/Node.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public List<T> children() {
6767
@SuppressWarnings("unchecked")
6868
public void forEachDown(Consumer<? super T> action) {
6969
action.accept((T) this);
70-
// please do not refactor it to a for-each loop
71-
// to avoid allocating iterator that performs concurrent modification checks
70+
// please do not refactor it to a for-each loop to avoid
71+
// allocating iterator that performs concurrent modification checks and extra stack traces
7272
for (int c = 0, size = children.size(); c < size; c++) {
7373
children.get(c).forEachDown(action);
7474
}
@@ -85,8 +85,8 @@ public <E extends T> void forEachDown(Class<E> typeToken, Consumer<? super E> ac
8585

8686
@SuppressWarnings("unchecked")
8787
public void forEachUp(Consumer<? super T> action) {
88-
// please do not refactor it to a for-each loop
89-
// to avoid allocating iterator that performs concurrent modification checks
88+
// please do not refactor it to a for-each loop to avoid
89+
// allocating iterator that performs concurrent modification checks and extra stack traces
9090
for (int c = 0, size = children.size(); c < size; c++) {
9191
children.get(c).forEachUp(action);
9292
}

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/QueryPlan.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ private static Object doTransformExpression(Object arg, Function<Expression, ? e
144144
if (arg instanceof List<?> c) {
145145
List<Object> transformed = null;
146146
boolean hasChanged = false;
147-
// please do not refactor it to a for-each loop
148-
// to avoid allocating iterator that performs concurrent modification checks
147+
// please do not refactor it to a for-each loop to avoid
148+
// allocating iterator that performs concurrent modification checks and extra stack traces
149149
for (int i = 0, size = c.size(); i < size; i++) {
150150
var e = c.get(i);
151151
Object next = doTransformExpression(e, traversal);
@@ -160,7 +160,7 @@ private static Object doTransformExpression(Object arg, Function<Expression, ? e
160160

161161
return hasChanged ? transformed : arg;
162162
}
163-
assert arg instanceof Set<?> == false : "Set arguments are not supported";
163+
assert arg instanceof Collection<?> == false : "Non-List Collection implementations are not supported";
164164

165165
return arg;
166166
}

0 commit comments

Comments
 (0)