Affects PMD Version: PMD ??? (1.2.2 is an invalid version...)
Rule: CloseResourceRule
Description:
The CloseResourceRule does not identify in case the resource variable got re assigned by developer
Code Sample demonstrating the issue:
public class Bar { public void withSQL() { Connection c = pool.getConnection(); try { // do stuff // oops, should not have assgined the connection again to the variable c = pool.getConnection(); } catch (SQLException ex) { // handle exception } finally { // oops, one connection leak'! c.close(); } } }
Expected outcome:
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4