From 341505c1c54ba16fd3d3a5b5cfe6891f8cd76842 Mon Sep 17 00:00:00 2001 From: "r.bogacki" Date: Tue, 7 May 2019 08:22:38 +0200 Subject: Removed null checks from ResourceRequestBuilder Removed unnecessary null checks from ResourceRequestBuilder according to comments from https://gerrit.onap.org/r/#/c/87001/ Change-Id: I21140d812982713229c322d772e6a10f7c7c044d Issue-ID: SO-1498 Signed-off-by: Robert Bogacki --- .../org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java index 0df25be714..8aab4ec818 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java @@ -151,13 +151,13 @@ public class ResourceRequestBuilder { Map resourceInputData = getResourceInputStr(serviceVnfCust, resourceCustomizationUuid); // find match in network resource - if (resourceInputData != null && resourceInputData.isEmpty()) { + if (resourceInputData.isEmpty()) { List> serviceNetworkCust = (List>) serviceResources.get("serviceNetworks"); resourceInputData = getResourceInputStr(serviceNetworkCust, resourceCustomizationUuid); // find match in AR resource - if (resourceInputData == null) { + if (resourceInputData.isEmpty()) { List> serviceArCust = (List>) serviceResources.get("serviceAllottedResources"); resourceInputData = getResourceInputStr(serviceArCust, resourceCustomizationUuid); @@ -166,7 +166,7 @@ public class ResourceRequestBuilder { String resourceInputStr = null; ResourceLevel resourceLevel = null; - if (resourceInputData != null) { + if (!resourceInputData.isEmpty()) { resourceInputStr = resourceInputData.get("resourceInput"); resourceLevel = ResourceLevel.valueOf(resourceInputData.get("nodeType")); } @@ -200,7 +200,7 @@ public class ResourceRequestBuilder { return resourceInputMap; } } - return null; + return new HashMap<>(); } // this method combines resource input with service input -- cgit 1.2.3-korg