Affects PMD Version: 6.30.0-SNAPSHOT
Rule:UseTryWithResources
Description:
From #2871 (comment)
Code Sample demonstrating the issue:
https://chunk.io/pmd/fc7db65b2c6a46eca4c9a0c3012482e2/diff/checkstyle/index.html#A360
import java.io.*; public class UseTryWithResources { void method() throws Exception { final String fileName = "Test"; final BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream(fileName), StandardCharsets.UTF_8)); try { // warning expected: Consider using a try-with-resources statement instead of explicitly closing the resource } finally { br.close(); } } }
Expected outcome:
Running PMD through: regression-tester
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