Removed redundant null check for retryCount to
prevent static analyzer warning
Issue-ID: SO-1841
Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com>
Change-Id: I9708b89082b56fb7bc24eca577f6a7db75ba79f9
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
index 54ffc59..43b362c 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
@@ -84,7 +84,7 @@
externalTaskId, getRetrySequence().length);
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, getRetrySequence().length, 10000);
- } else if (retryCount != null && retryCount - 1 == 0) {
+ } else if (retryCount == 1) {
externalTaskService.complete(externalTask, variables);
mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTaskId);
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
index 9a4f154..da5e8bb 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
@@ -97,7 +97,7 @@
externalTaskId, getRetrySequence().length);
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI,
UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, getRetrySequence().length, 10000);
- } else if (retryCount != null && retryCount - 1 == 0) {
+ } else if (retryCount == 1) {
externalTaskService.complete(externalTask, variables);
mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTaskId);
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java
index dc672ff..8699f8b 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java
@@ -60,7 +60,7 @@
externalTaskId, getRetrySequence().length);
externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK,
UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK, getRetrySequence().length, 10000);
- } else if (retryCount != null && retryCount - 1 == 0) {
+ } else if (retryCount == 1) {
externalTaskService.complete(externalTask, variables);
mdcSetup.setResponseCode(ONAPLogConstants.ResponseStatus.ERROR.toString());
logger.debug("The External Task {} Failed. All Retries Exhausted", externalTaskId);