divijvaidya commented on pull request #1502:
URL: https://github.com/apache/tinkerpop/pull/1502#issuecomment-983549704


   I thought of a bug in this implementation. 
   
   When we call `hasNext()` first time and there are no more results, we will 
close the traversal. `hasNext()` is supposed to be an idempotent operation. If 
we call `hasNext()` again on this closed traversal, we may encounter unexpected 
behaviour because we are again trying to find a result on a traversal that has 
already been closed (and the underlying storage implementation might have 
released resources).
   
   The fix would be to add a lifecycle state in Traversal.java. Set the 
lifecycle state to closed when close() is called. Once it is closed, any call 
to hasNext should return false and any call to next() should return 
NoSuchElement() exception.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to