Details
-
Type:
False-Positive
-
Status: Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Rules
-
Labels:None
Description
According to the java documentation of java.sql.Statement#close():
Note: When a Statement object is closed, its current ResultSet object, if one exists, is also closed.
It's not mandatory to close the ResultSet if the Statement is properly closed. The following issue is a false-positive:
try(Statement stmt = con.createStatement()) { ResultSet rs = stmt.executeQuery("SELECT a FROM tbl"); // false-positive // ... }
Attachments
Issue Links
- relates to
-
RSPEC-2095 Resources should be closed
- Active