TranslationService- Add null test before using nullable values 92/133392/3
authorshikha0203 <shivani.khare@est.tech>
Wed, 22 Feb 2023 15:48:48 +0000 (15:48 +0000)
committerMichael Morris <michael.morris@est.tech>
Mon, 27 Feb 2023 15:40:33 +0000 (15:40 +0000)
Issue-ID: SDC-4414
Signed-off-by: shikha0203 <shivani.khare@est.tech>
Change-Id: I7b80df4c650af677fb194d04dc6013adff08473b

openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java

index 97b5722..bf37d9b 100644 (file)
@@ -155,15 +155,15 @@ public class TranslationService {
     public void translateHelmFile(ServiceTemplate serviceTemplate, FileData heatFileData, TranslationContext context) {
         String heatFileName = heatFileData.getFile();
         Map<String, ParameterDefinition> inputs = serviceTemplate.getTopology_template().getInputs();
-        if (!Objects.isNull(inputs)) {
+        if (Objects.nonNull(inputs)) {
             inputs.entrySet().forEach(stringParameterDefinitionEntry -> {
                 List inputParamVFModuleList = getVFModulesList(inputs.get(stringParameterDefinitionEntry.getKey()));
                 if (!inputParamVFModuleList.contains(FileUtils.getFileWithoutExtention(heatFileName))) {
                     inputParamVFModuleList.add(FileUtils.getFileWithoutExtention(heatFileName));
                 }
             });
+            inputs.putAll(inputs);
         }
-        inputs.putAll(inputs);
     }
 
     private void handleHeatPseudoParam(String heatFileName, ServiceTemplate serviceTemplate, TranslationContext context) {