Fix bugs reported by sonar 61/46961/2
authorEthan Lynn <ethanlynnl@vmware.com>
Thu, 10 May 2018 07:26:22 +0000 (15:26 +0800)
committerEthan Lynn <ethanlynnl@vmware.com>
Thu, 10 May 2018 07:51:29 +0000 (15:51 +0800)
Use new variable in convertJsonToCloudOrchestrationRequest,
fix bug reported by sonar.

Change-Id: I3f95bd410d950d4661584c1510a66ce90d6785d5
Issue-ID: SO-580
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/CloudOrchestration.java

index 4801811..ecbe97c 100644 (file)
@@ -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() {