From efec7c5f7abb24da6d8ab93a71ee725e1c1f438f Mon Sep 17 00:00:00 2001 From: Chris André Date: Mon, 4 May 2020 17:00:03 -0400 Subject: UnifiedCompositionService - Refactor code to handle Optional value Issue-ID: SDC-3015 Signed-off-by: Chris Andre Change-Id: I1d15d20e9c603ff894c7c4be46b26d60745cb7e5 --- .../translator/services/heattotosca/UnifiedCompositionService.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'openecomp-be/lib') diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java index 81a5a199c2..69e74542da 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java @@ -3641,12 +3641,9 @@ public class UnifiedCompositionService { List identicalValuePropertyList) { switch (unifiedCompositionEntity) { case COMPUTE: - return identicalValuePropertyList.contains(getIdenticalValuePropertyName(inputName, - unifiedCompositionEntity).get()); - case OTHER: - return identicalValuePropertyList.contains(getIdenticalValuePropertyName(inputName, - unifiedCompositionEntity).get()); + Optional identicalValueProperty = getIdenticalValuePropertyName(inputName, unifiedCompositionEntity); + return identicalValueProperty.filter(identicalValuePropertyList::contains).isPresent(); case PORT: return getPortPropertyNameFromInput(inputName, identicalValuePropertyList).isPresent(); -- cgit 1.2.3-korg