summaryrefslogtreecommitdiffstats
path: root/common-be/src/main
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2023-05-25 10:55:59 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-05-25 17:48:39 +0000
commitb0c11fcb95f4c4d1ba2a9be611ea1453b0d90e85 (patch)
tree2d805252a95a5f2521723d85b51063d0ae0d7a43 /common-be/src/main
parentdffdf560049dac56f2c7d35dffec0e009c7939af (diff)
Fix NPE using concat TOSCA functions
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-4509 Change-Id: I57173758bdb8293ffeb774e4dfac3f18ab4abae8
Diffstat (limited to 'common-be/src/main')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaGetFunctionDataDefinition.java6
1 files changed, 3 insertions, 3 deletions
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 5bd9fe33db..82958a7532 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
@@ -89,7 +89,7 @@ public class ToscaGetFunctionDataDefinition implements ToscaFunction, ToscaFunct
);
}
if (propertySource == PropertySource.SELF) {
- if (toscaIndexList.size() > 0) {
+ if (CollectionUtils.isNotEmpty(toscaIndexList)) {
List<Object> parsedIndexList = new ArrayList<Object>();
toscaIndexList.forEach((obj) -> {
parsedIndexList.add(StringUtils.isNumeric(obj.toString()) ? Integer.parseInt(obj.toString()) : obj);
@@ -108,7 +108,7 @@ public class ToscaGetFunctionDataDefinition implements ToscaFunction, ToscaFunct
String.format("sourceName is required in order to generate the %s from INSTANCE value", functionType.getFunctionName())
);
}
- if (toscaIndexList.size() > 0) {
+ if (CollectionUtils.isNotEmpty(toscaIndexList)) {
List<Object> parsedIndexList = new ArrayList<Object>();
toscaIndexList.forEach((obj) -> {
parsedIndexList.add(StringUtils.isNumeric(obj.toString()) ? Integer.parseInt(obj.toString()) : obj);
@@ -129,7 +129,7 @@ public class ToscaGetFunctionDataDefinition implements ToscaFunction, ToscaFunct
List<Object> propertySourceCopy = new ArrayList<Object>(this.propertyPathFromSource);
List<Object> propertySourceOneCopy = new ArrayList<>();
propertySourceOneCopy.add(this.propertyPathFromSource.get(0));
- if (toscaIndexList.size() > 0) {
+ if (CollectionUtils.isNotEmpty(toscaIndexList)) {
propertySourceCopy.addAll(toscaIndexList);
propertySourceOneCopy.addAll(toscaIndexList);
}