summaryrefslogtreecommitdiffstats
path: root/common-be/src/main/java/org/openecomp
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2023-08-17 11:31:31 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-08-17 16:59:00 +0000
commit1f7c6cccdd3a9544a7760db9a305403def4e5365 (patch)
treeb45870b71388d38e1c59084c1f93308ce10e9201 /common-be/src/main/java/org/openecomp
parent7c61c7bb0369bc27d05c8801c8cb0cca41e494bf (diff)
Fix 'Tosca Function get_input in Properties Assignment error'-bug
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: If404b777b7be312d7f51c3d27905af898eb74eb6 Issue-ID: SDC-4598
Diffstat (limited to 'common-be/src/main/java/org/openecomp')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java1
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaGetFunctionDataDefinition.java9
2 files changed, 5 insertions, 5 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
index 5a7acf4919..ee5cd0ec96 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinition.java
@@ -332,7 +332,6 @@ public class PropertyDataDefinition extends ToscaDataDefinition {
return this.toscaGetFunctionType != null || this.toscaFunction != null;
}
-
@JsonIgnoreProperties
public boolean isToscaGetFunction() {
return this.toscaFunction != null
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaGetFunctionDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaGetFunctionDataDefinition.java
index 82958a7532..6f78c6828a 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaGetFunctionDataDefinition.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaGetFunctionDataDefinition.java
@@ -126,17 +126,18 @@ public class ToscaGetFunctionDataDefinition implements ToscaFunction, ToscaFunct
}
private Map<String, Object> buildGetInputFunctionValue() {
- List<Object> propertySourceCopy = new ArrayList<Object>(this.propertyPathFromSource);
- List<Object> propertySourceOneCopy = new ArrayList<>();
+ final List<Object> propertySourceCopy = new ArrayList<>(this.propertyPathFromSource);
+ final List<Object> propertySourceOneCopy = new ArrayList<>();
propertySourceOneCopy.add(this.propertyPathFromSource.get(0));
if (CollectionUtils.isNotEmpty(toscaIndexList)) {
propertySourceCopy.addAll(toscaIndexList);
propertySourceOneCopy.addAll(toscaIndexList);
}
if (this.propertyPathFromSource.size() == 1) {
- return Map.of(this.functionType.getFunctionName(), propertySourceOneCopy);
+ return Map.of(functionType.getFunctionName(), propertySourceOneCopy.size() == 1 ? propertySourceOneCopy.get(0) : propertySourceOneCopy);
+ } else {
+ return Map.of(functionType.getFunctionName(), propertySourceCopy.size() == 1 ? propertySourceCopy.get(0) : propertySourceCopy);
}
- return Map.of(this.functionType.getFunctionName(), propertySourceCopy);
}
@Override