aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBharath Balasubramanian <bharathb@research.att.com>2018-09-03 20:37:18 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-03 20:37:18 +0000
commit36e2dab449eae8ede28200f95bfaec2ab23bd486 (patch)
treeda5c7c92c8fb1a687e66edaf53b8de91509a0886
parentd74bc0962a011e47eeeaa4fd07571645d5befe68 (diff)
parent84ca0daa195dc3aa7ed6f31a56863ae9f92eac1a (diff)
Merge "Added fix for potential nullpointerexception"
-rw-r--r--src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java4
-rwxr-xr-xsrc/main/java/org/onap/music/rest/RestMusicAdminAPI.java19
2 files changed, 14 insertions, 9 deletions
diff --git a/src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java b/src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java
index 5f9c07ee..b09668b7 100644
--- a/src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java
+++ b/src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java
@@ -298,7 +298,7 @@ public class ZkStatelessLockService extends ProtocolSupport {
try {
stat = zookeeper.exists(id, false);
} catch (KeeperException | InterruptedException e1) {
- e1.printStackTrace();
+ logger.error(EELFLoggerDelegate.errorLogger, "Error in execute: " + e1);
}
Long ctime = stat.getCtime();
MusicUtil.zkNodeMap.put(id, ctime);
@@ -310,7 +310,7 @@ public class ZkStatelessLockService extends ProtocolSupport {
pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), ctime));
MusicCore.eventualPut(pQuery);
} catch (Exception e) {
- e.printStackTrace();
+ logger.error(EELFLoggerDelegate.errorLogger, "Error in execute: " + e);
}
break;
}
diff --git a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
index 48f28f8c..937ec77a 100755
--- a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
+++ b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
@@ -506,19 +506,24 @@ public class RestMusicAdminAPI {
logger.info(operation+ ": Operation :: changeValue: "+changeValueMap);
if(operation.equals("update")) {
String notifyWhenChangeIn = baseRequestObj.getNotifyWhenChangeIn(); // conductor.plans.status
- if(field_value.equals(notifyWhenChangeIn)) {
- notifyCallBackAppl(jsonResponse, baseRequestObj);
+ if(null!=field_value) {
+ if(field_value.equals(notifyWhenChangeIn)) {
+ notifyCallBackAppl(jsonResponse, baseRequestObj);
+ }
}
-
} else if(operation.equals("delete")) {
String notifyWhenDeletesIn = baseRequestObj.getNotifyWhenDeletesIn(); // conductor.plans.status
- if(field_value.equals(notifyWhenDeletesIn)) {
- notifyCallBackAppl(jsonResponse, baseRequestObj);
+ if(null!=field_value) {
+ if(field_value.equals(notifyWhenDeletesIn)) {
+ notifyCallBackAppl(jsonResponse, baseRequestObj);
+ }
}
} else if(operation.equals("insert")) {
String notifyWhenInsertsIn = baseRequestObj.getNotifyWhenInsertsIn(); // conductor.plans.status
- if(field_value.equals(notifyWhenInsertsIn)) {
- notifyCallBackAppl(jsonResponse, baseRequestObj);
+ if(null!=field_value) {
+ if(field_value.equals(notifyWhenInsertsIn)) {
+ notifyCallBackAppl(jsonResponse, baseRequestObj);
+ }
}
}
MusicCore.releaseLock(lockId, true);