From 7deb4e0e5f6cf06b7fbb27c6bda4e91f847f4075 Mon Sep 17 00:00:00 2001 From: shrek2000 Date: Mon, 4 Mar 2019 10:44:54 +0200 Subject: Fix Sonar Issue Add dependent child service to service Issue-ID: SDC-1987 Change-Id: If9a4d534b45aecc8f827e5d2ce80c35c13876078 Signed-off-by: shrek2000 --- .../sdc/be/components/impl/ServiceBusinessLogic.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'catalog-be') 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); -- cgit 1.2.3-korg