Description
The iterator here should be closed in a finally block: https://github.com/apache/tinkerpop/blob/3.4.8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java#L85
If the iterator is not closed, due to short circuit return, it could lead to open iterator leaks in the underlying storage.
The code should look like:
try { while (itty.hasNext()) { if (testValue(itty.next())) return true; } } finally { if (itty instanceof AutoCloseable) { ((AutoCloseable) itty).close(); } }