From cec4c5b5fac4fc0567535fa7254aae29160b2a0a Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Wed, 6 Sep 2023 15:12:44 +0100 Subject: [PATCH] Fix error when importing output with common attribute and property name Issue-ID: SDC-4618 Signed-off-by: JvD_Ericsson Change-Id: Ib0736fceded328387d696abc7091e4b1672313e1 --- .../openecomp/sdc/be/components/impl/OutputsBusinessLogic.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/OutputsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/OutputsBusinessLogic.java index 1f1f776245..ecab6402c6 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/OutputsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/OutputsBusinessLogic.java @@ -320,7 +320,6 @@ public class OutputsBusinessLogic extends BaseBusinessLogic { final String attributeName, final ComponentInstance componentInstance) { // From Instance - final List result = new ArrayList<>(); final var componentInstanceAttributes = componentInstance.getAttributes(); if (CollectionUtils.isNotEmpty(componentInstanceAttributes)) { final var componentInstanceAttributeOptional = componentInstanceAttributes.stream() @@ -329,12 +328,8 @@ public class OutputsBusinessLogic extends BaseBusinessLogic { final var componentInstOutputsMap = new ComponentInstOutputsMap(); componentInstOutputsMap.setComponentInstanceAttributes(Collections.singletonMap(componentInstance.getUniqueId(), Collections.singletonList(new ComponentInstanceAttribOutput(componentInstanceAttributeOptional.get())))); - final var createdOutputs = createMultipleOutputs(userId, componentUniqueId, ComponentTypeEnum.SERVICE, + return createMultipleOutputs(userId, componentUniqueId, ComponentTypeEnum.SERVICE, componentInstOutputsMap, true, false); - if (createdOutputs.isRight()) { - return Either.right((createdOutputs.right().value())); - } - result.addAll(createdOutputs.left().value()); } } final List componentInstanceProperties = componentInstance.getProperties(); @@ -350,7 +345,7 @@ public class OutputsBusinessLogic extends BaseBusinessLogic { return createMultipleOutputs(userId, componentUniqueId, ComponentTypeEnum.SERVICE, componentInstOutputsMap, true, false); } } - return Either.left(result); + return Either.left(new ArrayList<>()); } @NotNull -- 2.16.6