Sonar major issues 91/57791/1
authorSumapriya Sarvepalli <ss00493505@techmahindra.com>
Fri, 27 Jul 2018 06:07:01 +0000 (11:37 +0530)
committerSumapriya Sarvepalli <ss00493505@techmahindra.com>
Fri, 27 Jul 2018 06:07:01 +0000 (11:37 +0530)
 This block of commented-out lines of code should be removed
Sonar Link:

https://sonar.onap.org/project/issues?fileUuids=AWHCr-EXEU5FCDfKtlqk&id=org.onap.so%3Aso&resolved=false&severities=MAJOR
Location: src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java

Line No: L39 L75 L112 L338 L473 L536 L555 L715 L736 L756 L794 L844

Change-Id: I6cbecd22eff2d86911405811686619771ac3f74e
Issue-ID: SO-762
Signed-off-by: Sumapriya Sarvepalli <ss00493505@techmahindra.com>
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/json/JsonUtils.java

index 1869b93..0138835 100644 (file)
@@ -36,7 +36,7 @@ import org.json.JSONException;
 import org.json.JSONObject;\r
 import org.json.XML;\r
 import org.openecomp.mso.apihandler.common.ValidationException;\r
-//import org.openecomp.mso.bpmn.core.BPMNLogger;\r
+\r
 import org.openecomp.mso.bpmn.core.xml.XmlTool;\r
 import org.openecomp.mso.logger.MsoLogger;\r
 \r
@@ -72,7 +72,7 @@ public class JsonUtils {
         * @return String containing the JSON translation\r
         */\r
        public static String xml2json(String xml, Boolean pretty) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                try {\r
                        // name spaces cause problems, so just remove them\r
                        JSONObject jsonObj = XML.toJSONObject(XmlTool.removeNamespaces(xml));\r
@@ -109,7 +109,7 @@ public class JsonUtils {
         * @return String containing the XML translation\r
         */\r
        public static String json2xml(String jsonStr, Boolean pretty) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                try {\r
                        JSONObject jsonObj = new JSONObject(jsonStr);\r
                        if (pretty) {\r
@@ -335,7 +335,7 @@ public class JsonUtils {
         * @return String field value associated with keys\r
         */\r
        public static String getJsonValue(String jsonStr, String keys) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                try {\r
                                Object rawValue = getJsonRawValue(jsonStr, keys);\r
                                if (rawValue == null) {\r
@@ -470,7 +470,7 @@ public class JsonUtils {
         * @return String param value associated with field name\r
         */\r
        public static String getJsonParamValue(String jsonStr, String keys, String name, int index) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                try {\r
                        Object rawValue = getJsonRawValue(jsonStr, keys);\r
                        if (rawValue == null) {\r
@@ -533,7 +533,7 @@ public class JsonUtils {
         * @return String field value associated with key\r
         */\r
        public static String getJsonValueForKey(String jsonStr, String key) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                try {\r
                        JSONObject jsonObj = new JSONObject(jsonStr);\r
                        return getJsonValueForKey(jsonObj, key);\r
@@ -552,7 +552,7 @@ public class JsonUtils {
         * @return String field value associated with key\r
         */\r
        public static String getJsonValueForKey(JSONObject jsonObj, String key) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                String keyValue = null;\r
                try {\r
                        if (jsonObj.has(key)) {\r
@@ -712,7 +712,7 @@ public class JsonUtils {
         * @return String containing the updated JSON doc\r
         */\r
        public static String addJsonValue(String jsonStr, String keys, String value) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                // only attempt to insert the key/value pair if it does not exist\r
                if (!jsonValueExists(jsonStr, keys)) {\r
                        return putJsonValue(jsonStr, keys, value);\r
@@ -733,7 +733,7 @@ public class JsonUtils {
         * @return String containing the updated JSON doc\r
         */\r
        public static String updJsonValue(String jsonStr, String keys, String newValue) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                // only attempt to modify the key/value pair if it exists\r
                if (jsonValueExists(jsonStr, keys)) {\r
                        return putJsonValue(jsonStr, keys, newValue);\r
@@ -753,7 +753,7 @@ public class JsonUtils {
         * @return String containing the updated JSON doc\r
         */\r
        public static String delJsonValue(String jsonStr, String keys) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                // only attempt to remove the key/value pair if it exists\r
                if (jsonValueExists(jsonStr, keys)) {\r
                        // passing a null value results in a delete\r
@@ -791,7 +791,7 @@ public class JsonUtils {
         * @return Object field value associated with keys\r
         */\r
        private static Object getJsonRawValue(String jsonStr, String keys, Boolean wrap) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                String keyStr = "";\r
                try {\r
                        JSONObject jsonObj = new JSONObject(jsonStr);\r
@@ -841,7 +841,7 @@ public class JsonUtils {
         * @return String containing the updated JSON doc\r
         */\r
        private static String putJsonValue(String jsonStr, String keys, String value) {\r
-//             String isDebugLogEnabled = "true";\r
+\r
                String keyStr = "";\r
                try {\r
                        JSONObject jsonObj = new JSONObject(jsonStr);\r