summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-lib/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main')
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
index 1f0b728c53..332555d509 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaAnalyzerServiceImpl.java
@@ -920,10 +920,13 @@ public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService {
targetNodeType.setInterfaces(interfaceNoMerge.get());
return;
}
- targetNodeType.setInterfaces(combineInterfaces(sourceNodeType, targetNodeType));
+ combineInterfaces(sourceNodeType, targetNodeType).ifPresent(targetNodeType::setInterfaces);
}
- private Map<String, Object> combineInterfaces(NodeType sourceNodeType, NodeType targetNodeType) {
+ private Optional<Map<String, Object>> combineInterfaces(NodeType sourceNodeType, NodeType targetNodeType) {
+ if (MapUtils.isEmpty(sourceNodeType.getInterfaces())) {
+ return Optional.empty();
+ }
Map<String, Object> combineInterfaces = new HashMap<>();
for (Map.Entry<String, Object> sourceInterfaceDefEntry : sourceNodeType.getInterfaces().entrySet()) {
String interfaceName = sourceInterfaceDefEntry.getKey();
@@ -943,7 +946,7 @@ public class ToscaAnalyzerServiceImpl implements ToscaAnalyzerService {
}
}
- return combineInterfaces;
+ return Optional.of(combineInterfaces);
}
private Optional<Map<String, Object>> combineInterfaceNoMerge(NodeType sourceNodeType, NodeType targetNodeType) {