Fix Blocker/Critical sonar issues 47/13447/1
authorshashikanth <shashikanth.vh@huawei.com>
Tue, 19 Sep 2017 11:57:19 +0000 (17:27 +0530)
committershashikanth <shashikanth.vh@huawei.com>
Tue, 19 Sep 2017 11:57:20 +0000 (17:27 +0530)
Fix Blocker/Critical sonar issues in so module
https://sonar.onap.org/component_issues?id=org.openecomp.so%3Aso#resolved=false|severities=BLOCKER

Fixed condition that always evaluate to "true"

Issue-Id:SO-118
Change-Id: Iceec8653cad6c2ca5dc148644c761075fe207a66
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java

index 9dbd4b1..d5170af 100644 (file)
@@ -519,9 +519,7 @@ public class JsonUtils {
 //             String isDebugLogEnabled = "true";\r
                try {\r
                        JSONObject jsonObj = new JSONObject(jsonStr);\r
-                       if (jsonObj != null) {\r
-                               return getJsonValueForKey(jsonObj, key);\r
-                       }\r
+                       return getJsonValueForKey(jsonObj, key);\r
                } catch (Exception e) {\r
                                msoLogger.debug("getJsonValueForKey(): unable to parse json to retrieve value for field=" + key + ". Exception was: " + e.toString(), e);\r
                }\r