No violation reported by "Resources should be closed" squid:S2095

java

(Ankur) #1

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 ?


(Franck Biellmann) #2

Hello. Can anybody answer? I am very interested by the subject also… Thank you


(Franck Biellmann) #3

Hello.

Any chance to get an update?


(Ankur) #4

Still waiting for an update.
Can someone acknowledge the issue or provide a comment on why this is happening ?