From cf45bfe15be62a79dab30f69116e050d81e3a9ae Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Wed, 13 Mar 2019 14:56:05 -0400 Subject: Openstack adapter can't resolve HEAT parameter only cast to Element if value is of that type added XmlAccessorType annotations to classes map of string, object now correctly maps with jaxb Null comma delimited lists can convert to null as well Handle null values all types in input parameters map. Change-Id: Ic46ed31c05b8f8551d39b2267ae731829abfc1f0 Issue-ID: SO-1617 Signed-off-by: Benjamin, Max (mb388a) --- .../src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'adapters/mso-adapter-utils/src/main/java') diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java index 012c560689..47ff6c1b5f 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java @@ -1330,13 +1330,13 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{ logger.debug("Parameter: {} is of type {}", key, type); if ("string".equalsIgnoreCase(type)) { // Easiest! - String str = inputs.get(key).toString(); + String str = inputs.get(key) != null ? inputs.get(key).toString() : null; if (alias) newInputs.put(realName, str); else newInputs.put(key, str); } else if ("number".equalsIgnoreCase(type)) { - String integerString = inputs.get(key).toString(); + String integerString = inputs.get(key) != null ? inputs.get(key).toString() : null; Integer anInteger = null; try { anInteger = Integer.parseInt(integerString); @@ -1375,7 +1375,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{ else newInputs.put(key, json); } else if ("comma_delimited_list".equalsIgnoreCase(type)) { - String commaSeparated = inputs.get(key).toString(); + String commaSeparated = inputs.get(key) != null ? inputs.get(key).toString() : null; try { List anArrayList = this.convertCdlToArrayList(commaSeparated); if (alias) @@ -1390,7 +1390,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{ newInputs.put(key, commaSeparated); } } else if ("boolean".equalsIgnoreCase(type)) { - String booleanString = inputs.get(key).toString(); + String booleanString = inputs.get(key) != null ? inputs.get(key).toString() : null; Boolean aBool = Boolean.valueOf(booleanString); if (alias) newInputs.put(realName, aBool); -- cgit 1.2.3-korg