Skip to content

Commit

Permalink
[CALCITE-6251] InnerEnumerator in EnumerableDefaults::correlateBatchJ…
Browse files Browse the repository at this point in the history
…oin is not closed
  • Loading branch information
kramerul committed Feb 7, 2024
1 parent f7069cc commit 842efe5
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,7 @@ public static <TSource, TInner, TResult> Enumerable<TResult> correlateBatchJoin(
if (innerEnumerable == null) {
innerEnumerable = Linq4j.emptyEnumerable();
}
closeInner();
innerEnumerator = innerEnumerable.enumerator();

Check failure on line 1721 in linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java

View workflow job for this annotation

GitHub Actions / CheckerFramework (JDK 11)

[Task :linq4j:compileJava] [dereference.of.nullable] dereference of possibly-null reference innerEnumerable innerEnumerator = innerEnumerable.enumerator(); ^

Check failure on line 1721 in linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java

View workflow job for this annotation

GitHub Actions / CheckerFramework (JDK 11), oldest Guava

[Task :linq4j:compileJava] [dereference.of.nullable] dereference of possibly-null reference innerEnumerable innerEnumerator = innerEnumerable.enumerator(); ^
innerEnumHasNext = innerEnumerator.moveNext();

Expand Down Expand Up @@ -1799,11 +1800,16 @@ private boolean innerHasNext() {
i = -1;
}

@Override public void close() {
outerEnumerator.close();
private void closeInner() {
if (innerEnumerator != null) {
innerEnumerator.close();
innerEnumerator = null;
}
}

@Override public void close() {
outerEnumerator.close();
closeInner();
outerValue = null;
innerValue = null;
}
Expand Down

0 comments on commit 842efe5

Please sign in to comment.