diff options
author | Michael Lando <ml636r@att.com> | 2017-10-25 10:13:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-10-25 10:13:48 +0000 |
commit | d2469cabc662eef291f55f791700bd8c7c6ded10 (patch) | |
tree | 2788cbbcfa61c86f46ed3fdf5f2e2897aba82675 /catalog-be/src/main | |
parent | fa9d07d3ed584cadbb44de89c886d92591eae23f (diff) | |
parent | 3a7c314a597a7ceda028696b9542be15e747b2af (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.java | 20 |
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) { |