From: shashikanth Date: Mon, 25 Sep 2017 14:17:04 +0000 (+0530) Subject: Fixed string literal comparision redundant code X-Git-Tag: v1.1.0~274^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=cf1d4c5a274ecddf6098ed813806831d34a3488b;p=so.git 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 --- 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); }