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/DataModelUtil.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
index fd89faeb85..8da2fc8c54 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
@@ -1114,16 +1114,14 @@ public class DataModelUtil {
public static void addNodeTemplateCapability(NodeTemplate nodeTemplate, String capabilityId,
Map<String, Object> capabilityProperties,
Map<String, Object> capabilityAttributes) {
- List<Map<String, CapabilityAssignment>> capabilities = nodeTemplate.getCapabilities();
+ Map<String, CapabilityAssignment> capabilities = nodeTemplate.getCapabilities();
if (Objects.isNull(capabilities)) {
- capabilities = new ArrayList<>();
+ capabilities = new HashMap<>();
}
CapabilityAssignment capabilityAssignment = new CapabilityAssignment();
capabilityAssignment.setProperties(capabilityProperties);
capabilityAssignment.setAttributes(capabilityAttributes);
- Map<String, CapabilityAssignment> nodeTemplateCapability = new HashMap<>();
- nodeTemplateCapability.put(capabilityId, capabilityAssignment);
- capabilities.add(nodeTemplateCapability);
+ capabilities.put(capabilityId, capabilityAssignment);
nodeTemplate.setCapabilities(capabilities);
}