For the below java code though resource is closed in a finally block sonar is reporting:Use try-with-resources or close this “ObjectInputStream” in a “finally” clause.
FileInputStream fileInputStream = null; ObjectInputStream objIn = null; try { fileInputStream = new FileInputStream(value); objIn = new ObjectInputStream(fileInputStream) finally { if(fileInputStream != null){ fileInputStream.close(); if(objIn != null){ objIn.close(); }catch (IOException e){} How to Report a False-positive / False-negative Report False-positive / False-negative... Hey SonarSource Community! False-positives happen, as do false-negatives, and we’re eager to fix them. We are thrilled when our users report problems, so we can make our products better. What is a false-positive (FP)? A false-positive is when an issue is raised unexpectedly on code that should not trigger an issue, or where the suggested action doesn’t make any sense for the code. What is a false-negative (FN)? A false-negative is when an issue should be raised on a piece of code, but isn’t… And add additional information (like the product you’re using and if relevant, which version)
And add additional information (like the product you’re using and if relevant, which version)