Fixed major sonar issues 45/16245/2
authorshashikanth <shashikanth.vh@huawei.com>
Thu, 28 Sep 2017 06:59:16 +0000 (12:29 +0530)
committerShashikanth VH <shashikanth.vh@huawei.com>
Thu, 28 Sep 2017 09:53:29 +0000 (09:53 +0000)
Fix major sonar issues in clamp module
https://sonar.onap.org/component_issues?id=org.onap.clamp%3Aclds#resolved=false|severities=MAJOR|rules=squid%3AS1132%2Csquid%3AS1858

"get" returns a string, there's no need to call "toString()".

Issue-Id:CLAMP-54
Change-Id: I36cadab8e60122e1b4e244768d345cf04568d134
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java

index 192dcdb..8f80e07 100644 (file)
@@ -101,7 +101,7 @@ public class DcaeInventoryServices {
             String serviceUuid = sdcCatalogServices.getServiceUuidFromServiceInvariantId(invariantServiceUuid);\r
             String resourceUuid = "";\r
             if (resourceUuidList != null && !resourceUuidList.isEmpty()) {\r
-                resourceUuid = resourceUuidList.get(0).toString();\r
+                resourceUuid = resourceUuidList.get(0);\r
             }\r
             /* Invemtory service url is called in this method */\r
             isDcaeInfoAvailable = getDcaeInformation(artifactName, serviceUuid, resourceUuid);\r
@@ -215,7 +215,7 @@ public class DcaeInventoryServices {
             JSONArray itemsArray = (JSONArray) jsonObj.get("items");\r
             JSONObject dcaeServiceType0 = (JSONObject) itemsArray.get(0);\r
             daceInventoryResponse = dcaeServiceType0.toString();\r
-            logger.info(daceInventoryResponse.toString());\r
+            logger.info(daceInventoryResponse);\r
         }\r
         LoggingUtils.setTimeContext(startTime, new Date());\r
         metricsLogger.info("getDcaeInformation complete: number services returned=" + numServices);\r