Cleaning up unused variables and redundant initializers to 85/96785/2
authorOleksandr Moliavko <o.moliavko@samsung.com>
Wed, 9 Oct 2019 09:45:27 +0000 (12:45 +0300)
committerOleksandr Moliavko <o.moliavko@samsung.com>
Tue, 15 Oct 2019 07:48:39 +0000 (10:48 +0300)
remove static analyzer warnings

Issue-ID: SO-1841
Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com>
Change-Id: I5dee12e1935c152865963359d0fc869673393aad

bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java

index bcc3739..6debcfb 100644 (file)
@@ -333,8 +333,6 @@ public class WorkflowResource extends ProcessEngineAwareService {
         public void run() {
             setLogContext(processKey, inputVariables);
 
-            long startTime = System.currentTimeMillis();
-
             try {
 
                 RuntimeService runtimeService = getProcessEngineServices().getRuntimeService();
@@ -557,7 +555,6 @@ public class WorkflowResource extends ProcessEngineAwareService {
         // TODO filter only set of variables
         WorkflowResponse response = new WorkflowResponse();
 
-        long startTime = System.currentTimeMillis();
         try {
             ProcessEngineServices engine = getProcessEngineServices();
             List<HistoricVariableInstance> variables = engine.getHistoryService().createHistoricVariableInstanceQuery()
index 9cf7153..ad1e46a 100644 (file)
@@ -114,7 +114,6 @@ public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRep
     private List<InfraActiveRequests> executeInfraQuery(final CriteriaQuery<InfraActiveRequests> crit,
             final List<Predicate> 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<InfraActiveRequests> getOrchestrationFiltersFromInfraActive(
             final Map<String, List<String>> orchestrationMap) {
 
-
         final List<Predicate> predicates = new LinkedList<>();
         final CriteriaBuilder cb = entityManager.getCriteriaBuilder();
         final CriteriaQuery<InfraActiveRequests> 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;