Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

False positive OBL_UNSATISFIED_OBLIGATION with ResultSet #99

Closed
selliera opened this issue May 18, 2016 · 1 comment
Closed

False positive OBL_UNSATISFIED_OBLIGATION with ResultSet #99

selliera opened this issue May 18, 2016 · 1 comment

Comments

@selliera
Copy link

OBL_UNSATISFIED_OBLIGATION is raised for a java.sql.ResultSet obtained from a PreparedStatement that is properly enclosed in a try-with-resource.
However, the ResultSet documentation explicitly states this pattern is safe as all ResultSets obtained from a PreparedStetement are closed when the PreparedStatement is closed:
https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html
"A ResultSet object is automatically closed when the Statement object that generated it is closed, re-executed, or used to retrieve the next result from a sequence of multiple results."
See the attached sample, where findbugs report for line 13:
Rank: Of Concern (20), confidence: Normal
Pattern: OBL_UNSATISFIED_OBLIGATION
Type: OBL, Category: EXPERIMENTAL (Experimental)
ResultSetRelease.java.txt

@iloveeclipse
Copy link
Member

This project continues development in a new home: https://github.com/spotbugs/spotbugs/

Please do not open new issues here anymore!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants