aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreschcam <cameron.scholes@est.tech>2022-11-15 14:57:13 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2022-11-16 10:42:09 +0000
commit9eaadef100656d575d8cdeb92e0179dae9ac4828 (patch)
treeae10876c55014dcaec547bdf85e52c81d6deb612
parent990bd0f9e2d4ee80be782e66af60de5271b21d95 (diff)
Fix null check for propertiesName
Fixed null check for propertiesName in DefaultPropertyDeclarator Issue-ID: SDC-4265 Change-Id: I1c23c2a1344948973c75a2af8e38aaa94346355c Signed-off-by: eschcam <cameron.scholes@est.tech>
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java
index 0412516390..f3cafd703d 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/property/DefaultPropertyDeclarator.java
@@ -302,6 +302,7 @@ public abstract class DefaultPropertyDeclarator<PROPERTYOWNER extends Properties
String[] parsedPropNames = propInput.getParsedPropNames();
InputDefinition input;
boolean complexProperty = false;
+
if (propertiesName != null && !propertiesName.isEmpty() && selectedProp != null) {
complexProperty = true;
input = new InputDefinition(selectedProp);
@@ -310,21 +311,26 @@ public abstract class DefaultPropertyDeclarator<PROPERTYOWNER extends Properties
input = new InputDefinition(prop);
input.setDefaultValue(prop.getValue());
}
+
input.setName(inputName);
input.setUniqueId(UniqueIdBuilder.buildPropertyUniqueId(componentId, input.getName()));
input.setInputPath(propertiesName);
input.setInstanceUniqueId(propertiesOwner.getUniqueId());
input.setPropertyId(propInput.getUniqueId());
- if (Objects.isNull(input.getSubPropertyInputPath()) || (Objects.nonNull(propertiesName) && input.getSubPropertyInputPath()
+
+ if (Objects.isNull(input.getSubPropertyInputPath()) || (propertiesName != null && input.getSubPropertyInputPath()
.substring(input.getSubPropertyInputPath().lastIndexOf('#')).equals(propertiesName.substring(propertiesName.lastIndexOf('#'))))) {
input.setParentPropertyType(propInput.getType());
input.setSubPropertyInputPath(propertiesName);
}
+
changePropertyValueToGetInputValue(inputName, parsedPropNames, input, prop, complexProperty);
+
if (prop instanceof IComponentInstanceConnectedElement) {
((IComponentInstanceConnectedElement) prop).setComponentInstanceId(propertiesOwner.getUniqueId());
((IComponentInstanceConnectedElement) prop).setComponentInstanceName(propertiesOwner.getName());
}
+
return input;
}