summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorrama-huawei <rama.subba.reddy.s@huawei.com>2017-09-19 18:09:33 +0530
committerRama SubbaReddy <rama.subba.reddy.s@huawei.com>2017-09-19 14:57:52 +0000
commita6b9b0df565307fb66499f9862791f0d4fd4c68b (patch)
tree2bb87277ad568bb49856d698722d081ac71ef2a7 /src/main/java
parent607d0593819efba068a21bbee99417b741311e5d (diff)
Fix for Sonar Blocker issues
NullPointerException might be thrown DCAEGEN2-114 Change-Id: I79d82683e71a913d4446f07fe41af2be7174e92b Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertyService.java6
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());