General sonar fixes 42/93742/5
authorArindam Mondal <arind.mondal@samsung.com>
Mon, 19 Aug 2019 02:24:37 +0000 (11:24 +0900)
committerLukasz Muszkieta <lukasz.muszkieta@nokia.com>
Thu, 22 Aug 2019 07:13:05 +0000 (07:13 +0000)
+) Use format specifier to log exception
++) remove unused import

Issue-ID: SO-2226
Change-Id: I0938d624b918eddf30e96da4f12d7a06cc0ddfe1
Signed-off-by: arindamm <arind.mondal@samsung.com>
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java
bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java

index 8d02fa3..2c1d362 100644 (file)
@@ -118,7 +118,7 @@ public class ResourceRequestBuilder {
                     logger.info("resource resolved using model uuid");
                     String uuid = (String) JsonUtils.getJsonValue(eachResource, "resourceUuid");
                     if ((null != uuid) && uuid.equals(resource.getModelInfo().getModelUuid())) {
-                        logger.info("found resource uuid" + uuid);
+                        logger.info("found resource uuid {}", uuid);
                         String resourceParameters = JsonUtils.getJsonValue(eachResource, "parameters");
                         locationConstraints = JsonUtils.getJsonValue(resourceParameters, "locationConstraints");
                     }
@@ -133,7 +133,7 @@ public class ResourceRequestBuilder {
         Map<String, Object> uuiRequestInputs = null;
         if (JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs") != null) {
             String uuiRequestInputStr = JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs");
-            logger.info("resource input from UUI: " + uuiRequestInputStr);
+            logger.info("resource input from UUI:{} ", uuiRequestInputStr);
             if (uuiRequestInputStr == null || uuiRequestInputStr.isEmpty()) {
                 uuiRequestInputStr = "{}";
             }
@@ -371,7 +371,7 @@ public class ResourceRequestBuilder {
                     int val = Integer.parseInt(inputObj.toString());
                     return val;
                 } catch (NumberFormatException e) {
-                    logger.warn("Unable to parse to int", e.getMessage());
+                    logger.warn("Unable to parse to int", e);
                 }
             }
         }
index 7523c37..d036ce5 100644 (file)
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.core.domain;
 
 import java.util.UUID;
 import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonRootName;
 
 
index 050a2af..a4fc6e5 100644 (file)
@@ -99,7 +99,7 @@ public class MSOInfrastructureApplication {
             DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment();
             deployCustomWorkflows(deploymentBuilder);
         } catch (Exception e) {
-            logger.warn("Unable to invoke deploymentBuilder: " + e.getMessage());
+            logger.warn("Unable to invoke deploymentBuilder ", e);
         }
     }
 
@@ -140,7 +140,7 @@ public class MSOInfrastructureApplication {
                 deploymentBuilder.deploy();
             }
         } catch (Exception e) {
-            logger.warn("Unable to deploy custom workflows, " + e.getMessage());
+            logger.warn("Unable to deploy custom workflows ", e);
         }
     }
 }