diff options
author | Lukasz Muszkieta <lukasz.muszkieta@nokia.com> | 2020-06-02 15:12:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-06-02 15:12:11 +0000 |
commit | 48aad3a3181c6990abb84206027555d473cf71b3 (patch) | |
tree | a4eed3ce76dfb30d3913b31e45738907d854b7fd /adapters/mso-openstack-adapters/src/main | |
parent | ebff4ef04bbd786ced77b121420ce23b8a6f0a7c (diff) | |
parent | abe242987a35b162e2386b910c3f0cef6e3fef33 (diff) |
Merge "Sonar fixes"
Diffstat (limited to 'adapters/mso-openstack-adapters/src/main')
2 files changed, 6 insertions, 7 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAuditService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAuditService.java index 96a0ddc328..8cdd37d43f 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAuditService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AbstractAuditService.java @@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; -import java.util.Optional; @Component public abstract class AbstractAuditService extends ExternalTaskUtils { @@ -53,13 +52,13 @@ public abstract class AbstractAuditService extends ExternalTaskUtils { * @param auditList * @return */ - protected boolean didCreateAuditFail(Optional<AAIObjectAuditList> auditList) { - if (auditList.isPresent() && isAuditListNotNullAndNotEmpty(auditList.get())) { + protected boolean didCreateAuditFail(AAIObjectAuditList auditList) { + if (isAuditListNotNullAndNotEmpty(auditList)) { if (logger.isInfoEnabled()) { - logger.info("Audit Results: {}", auditList.get().toString()); + logger.info("Audit Results: {}", auditList.toString()); } - return auditList.get().getAuditList().stream().filter(auditObject -> !auditObject.isDoesObjectExist()) - .findFirst().map(v -> true).orElse(false); + return auditList.getAuditList().stream().filter(auditObject -> !auditObject.isDoesObjectExist()).findFirst() + .map(v -> true).orElse(false); } else { return false; } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java index 010475c87a..c06460c386 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/audit/AuditCreateStackService.java @@ -67,7 +67,7 @@ public class AuditCreateStackService extends AbstractAuditService { auditListOpt.get().setHeatStackName(auditInventory.getHeatStackName()); GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider(); variables.put("auditInventoryResult", objectMapper.getMapper().writeValueAsString(auditListOpt.get())); - success = !didCreateAuditFail(auditListOpt); + success = !didCreateAuditFail(auditListOpt.get()); } } catch (Exception e) { logger.error("Error during audit of stack", e); |