From 8c6be7c0fef13152716bf34096f5df5da7d77cc2 Mon Sep 17 00:00:00 2001 From: Soumendu Sekhar Acharya Date: Mon, 11 Dec 2017 15:26:33 +0530 Subject: sonar blocker for NullPointerException NullPointerException might be thrown as 'filePath' is nullable Sonar Link: https://sonar.onap.org/component_issues/index?id=org.onap.dmaap.messagerouter.messageservice%3AdmaapMR1#resolved=false|severities=BLOCKER|assignees=soumendu Location: src/main/java/com/att/nsa/dmaap/service/MMRestService.java Line No-65 Change-Id: I042592bee40553f262baf5861ef61e8404f45a80 Issue-ID: DMAAP-184 Signed-off-by: Soumendu Sekhar Acharya --- src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMap.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMap.java b/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMap.java index 0f7744c..7f12696 100644 --- a/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMap.java +++ b/src/main/java/com/att/nsa/dmaap/filemonitor/ServicePropertiesMap.java @@ -62,6 +62,7 @@ public class ServicePropertiesMap filePath = file.getPath(); } + if(filePath != null) { if(filePath.lastIndexOf(".json")>0){ ObjectMapper om = new ObjectMapper(); @@ -89,6 +90,7 @@ public class ServicePropertiesMap mapOfMaps.put(file.getName(), propMap); } + } logger.info("File - " + file.getName() + " is loaded into the map and the " + "corresponding system properties have been refreshed"); -- cgit 1.2.3-korg