diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java b/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java index bafdee2..bfbbeee 100644 --- a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java +++ b/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java @@ -26,7 +26,6 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; -//import org.json.JSONObject; import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; import org.openecomp.sdc.tosca.parser.utils.GeneralUtility; import org.openecomp.sdc.tosca.parser.utils.SdcToscaUtility; @@ -164,6 +163,7 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper { return cps; } + @SuppressWarnings("unchecked") private void buildPathMappedToValue(String path, Object property, Map<String, Object> pathsMap) { if (property instanceof Map) { for (Map.Entry<String, Object> item : ((Map<String, Object>) property).entrySet()) { @@ -339,6 +339,7 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper { return null; } + @SuppressWarnings({ "unchecked", "rawtypes" }) private Object iterateProcessPath(Integer index, Object current, String[] split) { if (current == null) { log.error("iterateProcessPath - this input has no default"); @@ -505,6 +506,7 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper { @Override //Sunny flow - covered with UT + @SuppressWarnings("unchecked") public List<Pair<NodeTemplate, NodeTemplate>> getNodeTemplatePairsByReqName( List<NodeTemplate> listOfReqNodeTemplates, List<NodeTemplate> listOfCapNodeTemplates, String reqName) { if (listOfReqNodeTemplates == null || listOfCapNodeTemplates == null || reqName == null) { @@ -732,6 +734,7 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper { return nt.getType().endsWith("VnfConfiguration"); } + @SuppressWarnings("unchecked") private Map<String, String> filterProperties(Object property, String path, FilterType filterType, String pattern, Map<String, String> filterMap) { if (property instanceof Map) { @@ -786,8 +789,14 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper { //Assumed to be unique property for the list private NodeTemplate getNodeTemplateByCustomizationUuid(List<NodeTemplate> nodeTemplates, String customizationId) { - Optional<NodeTemplate> findFirst = nodeTemplates.stream().filter(x -> (x.getMetaData() != null && customizationId.equals(x.getMetaData().getValue(PROPERTY_NAME_CUSTOMIZATIONUUID)))).findFirst(); - return findFirst.isPresent() ? findFirst.get() : null; + if (customizationId != null) { + Optional<NodeTemplate> findFirst = nodeTemplates.stream().filter(x -> (x.getMetaData() != null && customizationId.equals(x.getMetaData().getValue(PROPERTY_NAME_CUSTOMIZATIONUUID)))).findFirst(); + return findFirst.isPresent() ? findFirst.get() : null; + } + else { + log.error("getNodeTemplateByCustomizationUuid - customizationId is null"); + return null; + } } private Object processProperties(String[] split, LinkedHashMap<String, Property> properties) { |