summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib
diff options
context:
space:
mode:
authorfranciscovila <javier.paradela.vila@est.tech>2022-01-12 14:03:15 +0000
committerMichael Morris <michael.morris@est.tech>2022-01-13 09:30:32 +0000
commit5325a8ed571460b52d618963e37f5bda20fef727 (patch)
treecb4e163ff8d521316ca20551f45099cdb3c579b7 /openecomp-be/lib
parent566ae1c6de94d1bceb3f8b93db883cfa620560be (diff)
Fix use of Optional in TranslatorHeatToToscaParameterConverter
Checking the Optionals are present before getting their values in the TranslatorHeatToToscaParameterConverter class Issue-ID: SDC-3833 Signed-off-by: franciscovila <javier.paradela.vila@est.tech> Change-Id: I6721c028c420734f3a02f78468e4b22acbfb5be8
Diffstat (limited to 'openecomp-be/lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java
index 64915a0af7..9361b33e65 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java
@@ -233,7 +233,7 @@ public class TranslatorHeatToToscaParameterConverter {
FunctionTranslator functionTranslator = new FunctionTranslator(
getFunctionTranslateTo(serviceTemplate, null, heatFileName, heatOrchestrationTemplate, context), parameterName,
functionMapEntry.getValue(), null);
- return FunctionTranslationFactory.getInstance(functionMapEntry.getKey()).get().translateFunction(functionTranslator);
+ return FunctionTranslationFactory.getInstance(functionMapEntry.getKey()).isPresent() ? FunctionTranslationFactory.getInstance(functionMapEntry.getKey()).get().translateFunction(functionTranslator) : paramValue;
}
}
return paramValue;