From 44d74d78855bb6d9f7d9f87ade4dd9a8f629bf90 Mon Sep 17 00:00:00 2001 From: Oleksandr Moliavko Date: Wed, 9 Oct 2019 12:45:27 +0300 Subject: Cleaning up unused variables and redundant initializers to remove static analyzer warnings Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko Change-Id: I5dee12e1935c152865963359d0fc869673393aad --- .../repository/InfraActiveRequestsRepositoryImpl.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'mso-api-handlers/mso-requests-db-repositories') diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java index 9cf71538b1..ad1e46a1c6 100644 --- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java +++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java @@ -114,7 +114,6 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep private List executeInfraQuery(final CriteriaQuery crit, final List predicates, final Order order) { - final long startTime = System.currentTimeMillis(); logger.debug("Execute query on infra active request table"); final CriteriaBuilder cb = entityManager.getCriteriaBuilder(); @@ -131,15 +130,12 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep */ @Override public InfraActiveRequests getRequestFromInfraActive(final String requestId) { - final long startTime = System.currentTimeMillis(); logger.debug("Get request {} from InfraActiveRequests DB", requestId); - InfraActiveRequests ar = null; final Query query = entityManager .createQuery("from InfraActiveRequests where requestId = :requestId OR clientRequestId = :requestId"); query.setParameter(REQUEST_ID, requestId); - ar = this.getSingleResult(query); - return ar; + return this.getSingleResult(query); } /* @@ -239,7 +235,6 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep public List getOrchestrationFiltersFromInfraActive( final Map> orchestrationMap) { - final List predicates = new LinkedList<>(); final CriteriaBuilder cb = entityManager.getCriteriaBuilder(); final CriteriaQuery crit = cb.createQuery(InfraActiveRequests.class); @@ -416,17 +411,13 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep */ @Override public InfraActiveRequests getRequestFromInfraActive(final String requestId, final String requestType) { - final long startTime = System.currentTimeMillis(); logger.debug("Get infra request from DB with id {}", requestId); - InfraActiveRequests ar = null; - final Query query = entityManager.createQuery( "from InfraActiveRequests where (requestId = :requestId OR clientRequestId = :requestId) and requestType = :requestType"); query.setParameter(REQUEST_ID, requestId); query.setParameter(REQUEST_TYPE, requestType); - ar = this.getSingleResult(query); - return ar; + return this.getSingleResult(query); } @@ -440,7 +431,6 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep public InfraActiveRequests checkDuplicateByVnfName(final String vnfName, final String action, final String requestType) { - final long startTime = System.currentTimeMillis(); logger.debug("Get infra request from DB for VNF {} and action {} and requestType {}", vnfName, action, requestType); @@ -470,7 +460,6 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep public InfraActiveRequests checkDuplicateByVnfId(final String vnfId, final String action, final String requestType) { - final long startTime = System.currentTimeMillis(); logger.debug("Get list of infra requests from DB for VNF {} and action {}", vnfId, action); InfraActiveRequests ar = null; @@ -496,7 +485,6 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep */ @Override public InfraActiveRequests checkVnfIdStatus(final String operationalEnvironmentId) { - final long startTime = System.currentTimeMillis(); logger.debug("Get Infra request from DB for OperationalEnvironmentId {}", operationalEnvironmentId); InfraActiveRequests ar = null; -- cgit 1.2.3-korg