diff options
author | r.bogacki <r.bogacki@samsung.com> | 2019-07-10 11:09:31 +0200 |
---|---|---|
committer | Robert Bogacki <r.bogacki@samsung.com> | 2019-07-12 06:49:00 +0000 |
commit | c7113532f34e920d6cfe773cd84591fc863801ae (patch) | |
tree | 39b8539f72c1436fa59eed0e0ba1ea0b04805976 /mso-api-handlers | |
parent | 4f7af8bab030fc3d331816a706dd0a9e2974c455 (diff) |
Major Sonar fixes
Major Sonar fixes in different classes:
-Removed unused variables.
-Simplified diamond operators.
-Removed unnecessary imports.
-Removed unnecessary code.
Issue-ID: SO-2102
Signed-off-by: Robert Bogacki <r.bogacki@samsung.com>
Change-Id: Ib54fbe048700a4e31042481f0a9b13838552aee7
Diffstat (limited to 'mso-api-handlers')
-rw-r--r-- | mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java index 20e8fed32d..e9cd303c0b 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java @@ -88,9 +88,9 @@ public class CloudResourcesOrchestration { public Response unlockOrchestrationRequest(String requestJSON, @PathParam("requestId") String requestId, @PathParam("version") String version) throws ApiException { TenantIsolationRequest msoRequest = new TenantIsolationRequest(requestId); - InfraActiveRequests infraActiveRequest = null; + InfraActiveRequests infraActiveRequest; - CloudOrchestrationRequest cor = null; + CloudOrchestrationRequest cor; logger.debug("requestId is: {}", requestId); @@ -140,8 +140,8 @@ public class CloudResourcesOrchestration { } else { String status = infraActiveRequest.getRequestStatus(); - if (status.equalsIgnoreCase("IN_PROGRESS") || status.equalsIgnoreCase("PENDING") - || status.equalsIgnoreCase("PENDING_MANUAL_TASK")) { + if ("IN_PROGRESS".equalsIgnoreCase(status) || "PENDING".equalsIgnoreCase(status) + || "PENDING_MANUAL_TASK".equalsIgnoreCase(status)) { infraActiveRequest.setRequestStatus("UNLOCKED"); infraActiveRequest.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER); infraActiveRequest.setRequestId(requestId); @@ -181,8 +181,7 @@ public class CloudResourcesOrchestration { String requestId = requestIdKey.get(0); CloudOrchestrationResponse cloudOrchestrationGetResponse = new CloudOrchestrationResponse(); - TenantIsolationRequest tenantIsolationRequest = new TenantIsolationRequest(requestId); - InfraActiveRequests requestDB = null; + InfraActiveRequests requestDB; try { requestDB = requestDbClient.getInfraActiveRequestbyRequestId(requestId); @@ -213,8 +212,8 @@ public class CloudResourcesOrchestration { } else { TenantIsolationRequest tenantIsolationRequest = new TenantIsolationRequest(); - List<InfraActiveRequests> activeRequests = null; - CloudOrchestrationRequestList orchestrationList = null; + List<InfraActiveRequests> activeRequests; + CloudOrchestrationRequestList orchestrationList; Map<String, String> orchestrationMap; @@ -233,7 +232,7 @@ public class CloudResourcesOrchestration { } activeRequests = requestDbClient.getCloudOrchestrationFiltersFromInfraActive(orchestrationMap); orchestrationList = new CloudOrchestrationRequestList(); - List<CloudOrchestrationResponse> requestLists = new ArrayList<CloudOrchestrationResponse>(); + List<CloudOrchestrationResponse> requestLists = new ArrayList<>(); for (InfraActiveRequests infraActive : activeRequests) { |