nicktelford commented on PR #15135:
URL: https://github.com/apache/kafka/pull/15135#issuecomment-1878591135

   > Is there a way we could have caught this? (perhaps spotbugs telling that 
an autocloseable object is not getting closed)
   > 
   > see: 
https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html#obl-method-may-fail-to-clean-up-stream-or-resource-obl-unsatisfied-obligation
   
   It does seem like this could have been caught by some tooling. Usually, the 
problem with AutoCloseables are when they're created/closed across a scope that 
covers multiple methods, because you can't use a try-with-resources.
   
   But in this case, it's allocated in a local scope, so static analysis should 
be able to determine that it's never closed.


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to