From 3e6e4249d8815e76a776615f5ca41a79a3f74a8e Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Thu, 10 May 2018 15:26:22 +0800 Subject: Fix bugs reported by sonar Use new variable in convertJsonToCloudOrchestrationRequest, fix bug reported by sonar. Change-Id: I3f95bd410d950d4661584c1510a66ce90d6785d5 Issue-ID: SO-580 Signed-off-by: Ethan Lynn --- .../mso/apihandlerinfra/tenantisolation/CloudOrchestration.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mso-api-handlers/mso-api-handler-infra') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/CloudOrchestration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/CloudOrchestration.java index 4801811c41..ecbe97c637 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/CloudOrchestration.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/CloudOrchestration.java @@ -281,10 +281,11 @@ public class CloudOrchestration { private CloudOrchestrationRequest convertJsonToCloudOrchestrationRequest(String requestJSON, Action action, long startTime, CloudOrchestrationRequest cor) throws Exception { + CloudOrchestrationRequest new_cor = null; try{ msoLogger.debug("Converting incoming JSON request to Object"); ObjectMapper mapper = new ObjectMapper(); - cor = mapper.readValue(requestJSON, CloudOrchestrationRequest.class); + new_cor = mapper.readValue(requestJSON, CloudOrchestrationRequest.class); } catch(Exception e){ msoLogger.debug ("Mapping of request to JSON object failed : ", e); if (getTenantIsolationRequest().getRequestId () != null) { @@ -295,7 +296,7 @@ public class CloudOrchestration { msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, "Mapping of request to JSON object failed"); throw new Exception(e); } - return cor; + return new_cor; } public TenantIsolationRequest getTenantIsolationRequest() { -- cgit 1.2.3-korg