From c6fe0e0870271f83ef8aeb51d20650a31be76db4 Mon Sep 17 00:00:00 2001 From: "Sindhuri.A" Date: Fri, 19 Apr 2019 11:34:35 +0530 Subject: Replace type spec, define constant for literal Replace type specification, define constant for String literal MsoNetworkAdapterAsyncImpl class Issue-ID: SO-1490 Change-Id: Id4b7b8b3dc6d1aca1b76272f85beda9a6df7dfbb Signed-off-by: Sindhuri.A --- .../so/adapters/network/MsoNetworkAdapterAsyncImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'adapters') diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java index 4753b1c18d..d042c9eb19 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java @@ -71,6 +71,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { private static final String NETWORK_EXCEPTION_MSG = "Got a NetworkException on createNetwork: "; private static final String CREATE_NETWORK_ERROR_LOGMSG = "{} {} Error sending createNetwork notification {} "; private static final String FAULT_INFO_ERROR_LOGMSG = "{} {} Exception - fault info "; + private static final String SHARED = "shared"; @Autowired private Environment environment; @@ -127,11 +128,11 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { HashMap params = (HashMap) networkParams; if (params == null) - params = new HashMap(); + params = new HashMap<>(); String shared = null; String external = null; - if (params.containsKey("shared")) - shared = params.get("shared"); + if (params.containsKey(SHARED)) + shared = params.get(SHARED); if (params.containsKey("external")) external = params.get("external"); @@ -211,11 +212,11 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { HashMap params = (HashMap) networkParams; if (params == null) - params = new HashMap(); + params = new HashMap<>(); String shared = null; String external = null; - if (params.containsKey("shared")) - shared = params.get("shared"); + if (params.containsKey(SHARED)) + shared = params.get(SHARED); if (params.containsKey("external")) external = params.get("external"); -- cgit 1.2.3-korg