OR you create your objects with a try-with-resources (as demonstrated in the rule description, which is available from the issue box when you click “Why is this an issue”) and they’re closed automatically for you without all the rigmarole & if-ing.
Hi Ann
Thank you for your help! I could resolve the error follow your indicationes. I use Java 1.8, so I can’t use “try-with-resources”. Its ok for me use try/catch/finally.