diff options
Diffstat (limited to 'catalog-be/src/main/java/org')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java index f14164b36c..85b2d17029 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtil.java @@ -16,12 +16,13 @@ package org.openecomp.sdc.be.tosca.utils; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; - +import org.apache.commons.collections.MapUtils; import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition; import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition; import org.openecomp.sdc.be.model.Component; @@ -35,8 +36,6 @@ import org.openecomp.sdc.be.tosca.model.ToscaLifecycleOperationDefinition; import org.openecomp.sdc.be.tosca.model.ToscaNodeType; import org.openecomp.sdc.be.tosca.model.ToscaProperty; -import com.fasterxml.jackson.databind.ObjectMapper; - /** * @author KATYR * @since March 20, 2018 @@ -68,6 +67,10 @@ public class InterfacesOperationsToscaUtil { } final Map<String, InterfaceDefinition> interfaces = ((Resource) component).getInterfaces(); + if ( MapUtils.isEmpty(interfaces)) { + return null; + } + for (InterfaceDefinition interfaceDefinition : interfaces.values()) { ToscaInterfaceNodeType toscaInterfaceType = new ToscaInterfaceNodeType(); toscaInterfaceType.setDerived_from(DERIVED_FROM_STANDARD_INTERFACE); @@ -105,7 +108,7 @@ public class InterfacesOperationsToscaUtil { } final Map<String, InterfaceDefinition> interfaces = ((Resource) component).getInterfaces(); - if (Objects.isNull(interfaces)) { + if ( MapUtils.isEmpty(interfaces)) { return; } for (InterfaceDefinition interfaceDefinition : interfaces.values()) { @@ -143,7 +146,7 @@ public class InterfacesOperationsToscaUtil { /*** * workaround for : currently "defaultp" is not being converted to "default" by the relevant code in ToscaExportHandler - * any string key named "defaultp" will have its named changed to "default" + * so, any string Map key named "defaultp" will have its named changed to "default" * @param operationsMap the map to update */ private static void handleDefaults(Map<String, Object> operationsMap) { |