diff options
author | varun gudisena <vg411h@att.com> | 2017-09-22 23:57:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-22 23:57:32 +0000 |
commit | f5b284e5e0eacfec3312d3318ec769269e1ec2a5 (patch) | |
tree | b283b283cd30d481d3143150eb5e5973cc45a170 | |
parent | 28b63125d4e277f501271979dede62caf01e9a9b (diff) | |
parent | a6b9b0df565307fb66499f9862791f0d4fd4c68b (diff) |
Merge "Fix for Sonar Blocker issues"
-rw-r--r-- | src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertyService.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertyService.java b/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertyService.java index e4f4e03..9f9c862 100644 --- a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertyService.java +++ b/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertyService.java @@ -90,7 +90,7 @@ public class ServicePropertyService { FileInputStream fis = null; if (fileList == null) - fileList = new ArrayList<File>(); + fileList = new ArrayList<>(); // get all the files that are ".json" or ".properties", from a directory // & it's sub-directories @@ -110,7 +110,9 @@ public class ServicePropertyService { } catch (Exception ioe) { logger.error("Error reading the file stream ", ioe); } finally { - fis.close(); + if (fis != null) { + fis.close(); + } } } else if (file.isDirectory()) { getFileList(file.getPath()); |