From: shrek2000 Date: Mon, 4 Mar 2019 08:44:54 +0000 (+0200) Subject: Fix Sonar Issue X-Git-Tag: 1.4.0~102 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F96%2F79596%2F2;p=sdc.git Fix Sonar Issue Add dependent child service to service Issue-ID: SDC-1987 Change-Id: If9a4d534b45aecc8f827e5d2ce80c35c13876078 Signed-off-by: shrek2000 --- diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java index e9c46cadcf..dfe1467a9c 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java @@ -2246,13 +2246,8 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { public Either updateServiceFilter(String serviceId, String componentInstanceId, List constraints, User inUser, boolean lock) { String errorContext = "createIfNotAlreadyExistServiceFilter"; - Either eitherCreator1 = null; User user = validateUserExists(inUser, errorContext, true); validateUserRole(user, Arrays.asList(Role.DESIGNER, Role.ADMIN)); - if (eitherCreator1 != null && eitherCreator1.isRight()) { - return Either.right(eitherCreator1.right().value()); - } - Either serviceStorageOperationStatusEither = toscaOperationFacade.getToscaElement(serviceId); if(serviceStorageOperationStatusEither.isRight()){ @@ -2292,8 +2287,7 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { } CINodeFilterDataDefinition serviceFilterResult; try { - List properties = (List) constraints. - stream().map(this::getRequirementNodeFilterPropertyDataDefinition).collect(Collectors.toList()); + List properties = constraints.stream().map(this::getRequirementNodeFilterPropertyDataDefinition).collect(Collectors.toList()); Either result = serviceFilterOperation.updateProperties(serviceId, componentInstanceId, serviceFilter ,properties); if (result.isRight()) { @@ -2329,12 +2323,8 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { public Either addOrDeleteServiceFilter(String serviceId, String componentInstanceId, NodeFilterConstraintAction action, String constraint, int position, User inUser, boolean lock) { String errorContext = "createIfNotAlreadyExistServiceFilter"; - Either eitherCreator1 = null; User user = validateUserExists(inUser, errorContext, true); validateUserRole(user, Arrays.asList(Role.DESIGNER, Role.ADMIN)); - if (eitherCreator1 != null && eitherCreator1.isRight()) { - return Either.right(eitherCreator1.right().value()); - } Either serviceStorageOperationStatusEither = toscaOperationFacade.getToscaElement(serviceId);