aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-10-25 10:13:48 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-25 10:13:48 +0000
commitd2469cabc662eef291f55f791700bd8c7c6ded10 (patch)
tree2788cbbcfa61c86f46ed3fdf5f2e2897aba82675 /catalog-be/src/main
parentfa9d07d3ed584cadbb44de89c886d92591eae23f (diff)
parent3a7c314a597a7ceda028696b9542be15e747b2af (diff)
Merge "align MME" into release-1.1.0
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java
index 646a7ecc8b..68adbd5ae3 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/PropertyConvertor.java
@@ -74,7 +74,9 @@ public class PropertyConvertor {
props.stream().filter(p -> p.getOwnerId() == null || p.getOwnerId().equals(component.getUniqueId())).forEach(property -> {
ToscaProperty prop = convertProperty(dataTypes, property, false);
- properties.put(property.getName(), prop);
+ if (prop != null) {
+ properties.put(property.getName(), prop);
+ }
});
if (!properties.isEmpty()) {
toscaNodeType.setProperties(properties);
@@ -98,13 +100,17 @@ public class PropertyConvertor {
}
log.trace("try to convert property {} from type {} with default value [{}]", property.getName(), property.getType(), property.getDefaultValue());
prop.setDefaultp(convertToToscaObject(property.getType(), property.getDefaultValue(), innerType, dataTypes));
+
+ if (prop.getDefaultp() == null) {
+ return null;
+ }
prop.setType(property.getType());
- prop.setDescription(property.getDescription());
- if (isCapabiltyProperty) {
- prop.setStatus(property.getStatus());
- prop.setRequired(property.isRequired());
- }
- return prop;
+ prop.setDescription(property.getDescription());
+ if (isCapabiltyProperty) {
+ prop.setStatus(property.getStatus());
+ prop.setRequired(property.isRequired());
+ }
+ return prop;
}
public Object convertToToscaObject(String propertyType, String value, String innerType, Map<String, DataTypeDefinition> dataTypes) {