diff options
author | 2021-01-19 10:54:52 +0100 | |
---|---|---|
committer | 2021-01-20 10:34:31 +0000 | |
commit | 5ce2da3100483eb505876b428c7c490ff445ba5c (patch) | |
tree | fdff7d173e531ed0f5a3f47652fc84b51a732bc9 /catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java | |
parent | 3315931d554d25687737084ba70e23432e96c030 (diff) |
Remove dead code
Remove unused variables
Remove unnecessary statements
Issue-ID: SDC-3428
Signed-off-by: JulienBe <julien.bertozzi@intl.att.com>
Change-Id: Iddc8ffdc141edd409d50f90c03cb6612f6ebf042
Signed-off-by: JulienBe <julien.bertozzi@intl.att.com>
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java index 5ba56fda5b..46338c2986 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DistributionServiceServlet.java @@ -95,24 +95,15 @@ public class DistributionServiceServlet extends BeGenericServlet { String url = request.getMethod() + " " + request.getRequestURI(); log.debug("Start handle request of {}", url); - Response response = null; - ResponseFormat responseFormat = null; - try { Either<DistributionStatusOfServiceListResponce, ResponseFormat> actionResponse = distributionMonitoringLogic.getListOfDistributionServiceStatus(serviceUUID, userId); if (actionResponse.isRight()) { - - responseFormat = actionResponse.right().value(); - response = buildErrorResponse(responseFormat); + return buildErrorResponse(actionResponse.right().value()); } else { - responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); - response = buildOkResponse(responseFormat, actionResponse.left().value()); + return buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), actionResponse.left().value()); } - - return response; - } catch (Exception e) { BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Get Distribution list for Service"); log.debug("failed to get service distribution statuses", e); @@ -138,27 +129,18 @@ public class DistributionServiceServlet extends BeGenericServlet { String url = request.getMethod() + " " + request.getRequestURI(); log.debug("Start handle request of {}", url); - Response response = null; - ResponseFormat responseFormat = null; - try { Either<DistributionStatusListResponse, ResponseFormat> actionResponse = distributionMonitoringLogic.getListOfDistributionStatus(did, userId); if (actionResponse.isRight()) { - - responseFormat = actionResponse.right().value(); + ResponseFormat responseFormat = actionResponse.right().value(); log.debug("failed to fount statuses for did {} {}", did, responseFormat); - response = buildErrorResponse(responseFormat); + return buildErrorResponse(responseFormat); } else { - - responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); + ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); log.debug("success to fount statuses for did {} {}", did, actionResponse.left().value()); - response = buildOkResponse(responseFormat, actionResponse.left().value()); - + return buildOkResponse(responseFormat, actionResponse.left().value()); } - - return response; - } catch (Exception e) { BeEcompErrorManager.getInstance().logBeRestApiGeneralError("Get Distribution Status"); log.debug("failed to get distribution status ", e); |