Muliple streams closed inside the finally block are not scanned by sonarqube


(mohit) #1
  • versions used (SonarQube 7.4)
  • steps to reproduce
  1. Open multiple stream in a try block.
  2. Then closed all open stream in finally block.
  3. Now run sonarqube scanner.
  4. Sonarqube didn’t recognize all th closed stream except the first one. And still shows it as a bug in the report that resource need to be closed in finally clause.

(mohit) #2

Its working fine. I have to use multiple try catch block for each stream closed.