diff options
author | shrek2000 <orenkle@amdocs.com> | 2019-03-04 10:44:54 +0200 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2019-03-04 11:42:32 +0000 |
commit | 7deb4e0e5f6cf06b7fbb27c6bda4e91f847f4075 (patch) | |
tree | f9633cb2e69f513192b5045dbcb265989a66de97 | |
parent | 1f7c57414533b9886962ede7b19a29669fe7a59a (diff) |
Fix Sonar Issue
Add dependent child service to service
Issue-ID: SDC-1987
Change-Id: If9a4d534b45aecc8f827e5d2ce80c35c13876078
Signed-off-by: shrek2000 <orenkle@amdocs.com>
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java | 12 |
1 files changed, 1 insertions, 11 deletions
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<CINodeFilterDataDefinition, ResponseFormat> updateServiceFilter(String serviceId, String componentInstanceId, List<String> constraints, User inUser, boolean lock) { String errorContext = "createIfNotAlreadyExistServiceFilter"; - Either<?, ResponseFormat> 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<Service, StorageOperationStatus> serviceStorageOperationStatusEither = toscaOperationFacade.getToscaElement(serviceId); if(serviceStorageOperationStatusEither.isRight()){ @@ -2292,8 +2287,7 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { } CINodeFilterDataDefinition serviceFilterResult; try { - List<RequirementNodeFilterPropertyDataDefinition> properties = (List<RequirementNodeFilterPropertyDataDefinition>) constraints. - stream().map(this::getRequirementNodeFilterPropertyDataDefinition).collect(Collectors.toList()); + List<RequirementNodeFilterPropertyDataDefinition> properties = constraints.stream().map(this::getRequirementNodeFilterPropertyDataDefinition).collect(Collectors.toList()); Either<CINodeFilterDataDefinition, StorageOperationStatus> result = serviceFilterOperation.updateProperties(serviceId, componentInstanceId, serviceFilter ,properties); if (result.isRight()) { @@ -2329,12 +2323,8 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { public Either<CINodeFilterDataDefinition, ResponseFormat> addOrDeleteServiceFilter(String serviceId, String componentInstanceId, NodeFilterConstraintAction action, String constraint, int position, User inUser, boolean lock) { String errorContext = "createIfNotAlreadyExistServiceFilter"; - Either<?, ResponseFormat> 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<Service, StorageOperationStatus> serviceStorageOperationStatusEither = toscaOperationFacade.getToscaElement(serviceId); |