From 8bfcb5ca8fbd30ecfde7c9ee2d52a5f8b03f5c90 Mon Sep 17 00:00:00 2001 From: "r.bogacki" Date: Tue, 12 Feb 2019 11:41:29 +0100 Subject: Fixed possible NPE in ResourceRequestBuilder According to Sonar current implementation could cause NullPointerException. Added JUnit test. Change-Id: I840c018bed346d85e2042c7308bdd27197f50b46 Issue-ID: SO-1498 Signed-off-by: Robert Bogacki --- .../java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bpmn/MSOCommonBPMN/src/main/java/org/onap') 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 025b533dc0..750f25532c 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 @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -154,7 +156,7 @@ public class ResourceRequestBuilder { } } - if (resourceInputStr != null || !resourceInputStr.equals("")) { + if (resourceInputStr != null && !resourceInputStr.isEmpty()) { return getResourceInput(resourceInputStr, serviceInputs); } -- cgit 1.2.3-korg