From 34d21a756721d8162a277c839c3e1ffa6544cb89 Mon Sep 17 00:00:00 2001 From: sindhu3672 Date: Thu, 8 Aug 2019 11:40:48 +0530 Subject: Shift string literal to left side of equals(avoid null pointer ex) Avoid null pointer exception mso-openstack-adapters classes Issue-ID: SO-2187 Signed-off-by: sindhu3672 Change-Id: Ie7099318a79162aed26ec3a8e4a013cece367736 --- .../main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java | 2 +- .../src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'adapters/mso-openstack-adapters') diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java index 96e5db7ce7..f09fa34cb9 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImpl.java @@ -854,7 +854,7 @@ public class MsoVnfCloudifyAdapterImpl implements MsoVnfAdapter { // Include aliases. String alias = htp.getParamAlias(); - if (alias != null && !alias.equals("") && !params.containsKey(alias)) { + if (alias != null && !"".equals(alias) && !params.containsKey(alias)) { params.put(alias, htp); } } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java index d5fe285274..41bcc8c481 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java @@ -323,7 +323,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter { String type = templateParam.getParamType(); logger.debug("Parameter: {} is of type ", templateParam.getParamName(), type); - if (type.equalsIgnoreCase("number")) { + if ("number".equalsIgnoreCase(type)) { try { return Integer.valueOf(inputValue.toString()); } catch (Exception e) { -- cgit 1.2.3-korg