diff options
author | 2020-05-04 17:00:03 -0400 | |
---|---|---|
committer | 2020-05-05 10:56:47 +0000 | |
commit | efec7c5f7abb24da6d8ab93a71ee725e1c1f438f (patch) | |
tree | 25542d469c762ff62fe78ce6f3ecd69a67f70e4a /openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java | |
parent | 45d6bf5520f9c70e57e473b109870b8ad0eb7251 (diff) |
UnifiedCompositionService - Refactor code to handle Optional value
Issue-ID: SDC-3015
Signed-off-by: Chris Andre <chris.andre@yoppworks.com>
Change-Id: I1d15d20e9c603ff894c7c4be46b26d60745cb7e5
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java | 7 |
1 files changed, 2 insertions, 5 deletions
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<String> identicalValuePropertyList) { switch (unifiedCompositionEntity) { case COMPUTE: - return identicalValuePropertyList.contains(getIdenticalValuePropertyName(inputName, - unifiedCompositionEntity).get()); - case OTHER: - return identicalValuePropertyList.contains(getIdenticalValuePropertyName(inputName, - unifiedCompositionEntity).get()); + Optional<String> identicalValueProperty = getIdenticalValuePropertyName(inputName, unifiedCompositionEntity); + return identicalValueProperty.filter(identicalValuePropertyList::contains).isPresent(); case PORT: return getPortPropertyNameFromInput(inputName, identicalValuePropertyList).isPresent(); |