From 586b9e02a7a4a3ccef45a760e837db892209e6cb Mon Sep 17 00:00:00 2001 From: "r.bogacki" Date: Tue, 9 Jul 2019 13:31:36 +0200 Subject: Sonar fixes in ManualTasks Code fixes in ManualTasks according to the Sonar analysis. -Removed unnecessary code. -Removed unused imports. -Removed unused variables. Issue-ID: SO-2100 Signed-off-by: Robert Bogacki Change-Id: I79848456cc88b7f2cb812f7054bb6cec12b584c0 --- .../main/java/org/onap/so/apihandlerinfra/ManualTasks.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'mso-api-handlers/mso-api-handler-infra/src/main') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java index 113baf96e6..b9b7fcc0d4 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java @@ -50,8 +50,6 @@ import org.onap.so.apihandlerinfra.tasksbeans.TaskRequestReference; import org.onap.so.apihandlerinfra.tasksbeans.TasksRequest; import org.onap.so.apihandlerinfra.tasksbeans.Value; import org.onap.so.apihandlerinfra.tasksbeans.Variables; -import org.onap.so.constants.Status; -import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.exceptions.ValidationException; import org.onap.so.logger.ErrorCode; import org.onap.so.logger.MessageEnum; @@ -94,7 +92,6 @@ public class ManualTasks { String requestId = requestContext.getProperty("requestId").toString(); logger.info(LoggingAnchor.TWO, MessageEnum.APIH_GENERATED_REQUEST_ID.toString(), requestId); - long startTime = System.currentTimeMillis(); logger.debug("requestId is: {}", requestId); TasksRequest taskRequest = null; String apiVersion = version.substring(1); @@ -141,9 +138,6 @@ public class ManualTasks { throw validateException; } - // Create Request Record - InfraActiveRequests currentActiveReq = - msoRequest.createRequestObject(taskRequest, Action.completeTask, requestId, Status.PENDING, request); // Transform the request to Camunda-style Complete request Variables variablesForComplete = new Variables(); @@ -157,7 +151,7 @@ public class ManualTasks { variablesForComplete.setResponseValue(responseValue); variablesForComplete.setRequestorId(requestorIdValue); - String camundaJsonReq = null; + String camundaJsonReq; try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); @@ -176,9 +170,8 @@ public class ManualTasks { throw validateException; } - RequestClient requestClient = null; - HttpResponse response = null; - long subStartTime = System.currentTimeMillis(); + RequestClient requestClient; + HttpResponse response; String requestUrl = taskUri + "/" + taskId + "/complete"; try { requestClient = reqClientFactory.getRequestClient(requestUrl); -- cgit 1.2.3-korg