diff options
author | shashikanth <shashikanth.vh@huawei.com> | 2017-09-25 19:47:04 +0530 |
---|---|---|
committer | Shashikanth VH <shashikanth.vh@huawei.com> | 2017-09-25 14:19:33 +0000 |
commit | cf1d4c5a274ecddf6098ed813806831d34a3488b (patch) | |
tree | 28c501fa446b143e1ed156990c875b2fd3980982 /bpmn/MSOCoreBPMN/src | |
parent | cf8b91603edf8eaad3cb84c85a222c2e9793bf33 (diff) |
Fixed string literal comparision redundant code
Move the "content" string literal on the left side of this string comparison.
Issue-Id:SO-118
Change-Id: Ice9ef2d94f594669f0399d31e5346e3c0be66c13
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
Diffstat (limited to 'bpmn/MSOCoreBPMN/src')
-rw-r--r-- | bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java index d5170af22d..d0de819e03 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java @@ -156,7 +156,7 @@ public class JsonUtils { str = null;
}
// append the content to the XML output
- if (key.equals("content")) {
+ if ("content".equals(key)) {
if (curObj instanceof JSONArray) {
jsonArr = (JSONArray) curObj;
len = jsonArr.length();
@@ -952,11 +952,9 @@ public class JsonUtils { try {
Object rawValue = getJsonRawValue(jsonStr, keys);
- if (rawValue == null) {
- return false;
- } else {
- return true;
- }
+
+ return !(rawValue == null);
+
} catch (Exception e) {
msoLogger.debug("jsonElementExist(): unable to determine if json element exist. Exception is: " + e.toString(),e);
}
|