ensured resources are closed

This commit is contained in:
Jeremy Long
2016-11-22 06:39:50 -05:00
parent 6838b9b950
commit 316b936326

View File

@@ -280,6 +280,7 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer {
return false; return false;
} }
if (pomEntries != null && pomEntries.size() <= 1) { if (pomEntries != null && pomEntries.size() <= 1) {
try {
String path = null; String path = null;
Properties pomProperties = null; Properties pomProperties = null;
File pomFile = null; File pomFile = null;
@@ -303,6 +304,13 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer {
} else { } else {
return false; return false;
} }
} finally {
try {
jar.close();
} catch (IOException ex) {
LOGGER.trace("", ex);
}
}
} }
//reported possible null dereference on pomEntries is on a non-feasible path //reported possible null dereference on pomEntries is on a non-feasible path