I am using SonarQube 6.7.4 and trying to understand why the rule “Resources should be closed” squid:S2095 is not working the way it is documented.
The documentation says - “Connections, streams, files, and other classes that implement the Closeable interface or its super-interface, AutoCloseable, needs to be closed after use. Further, that close call must be made in a finally block”.
I have left open InputStream, StringWriter and PrintWriter, wrote no finally block, but the rule does not report any violation.
Any hints ?