From 7869c1c81cdb575f1d3e59f21951226b38f02418 Mon Sep 17 00:00:00 2001 From: shashikanth Date: Tue, 26 Sep 2017 19:02:24 +0530 Subject: Fixed major sonar issues Fix major sonar issues in so module https://sonar.onap.org/component_issues?id=org.openecomp.so%3Aso#resolved=false|severities=MAJOR|rules=squid%3AS1132 Move the "vlan" string literal on the left side of this string comparison. Issue-Id: APPC-186 Change-Id: If8f330c4a4f053bbee1064b325dc1cbe6bcd70ae Signed-off-by: shashikanth.vh --- .../java/org/openecomp/mso/openstack/beans/NetworkInfo.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'adapters/mso-adapter-utils') diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java index 11cd5dfbd5..9f2c275670 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java +++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java @@ -42,13 +42,13 @@ public class NetworkInfo { private String id = ""; private NetworkStatus status = NetworkStatus.UNKNOWN; private String provider = ""; - private List vlans = new ArrayList(); - private List subnets = new ArrayList(); + private List vlans = new ArrayList<>(); + private List subnets = new ArrayList<>(); private String shared = ""; static Map NetworkStatusMap; static { - NetworkStatusMap = new HashMap(); + NetworkStatusMap = new HashMap<>(); NetworkStatusMap.put("ACTIVE", NetworkStatus.ACTIVE); NetworkStatusMap.put("DOWN", NetworkStatus.DOWN); NetworkStatusMap.put("BUILD", NetworkStatus.BUILD); @@ -96,14 +96,14 @@ public class NetworkInfo { if (network.getProviderPhysicalNetwork() != null) { this.provider = network.getProviderPhysicalNetwork(); - if (network.getProviderNetworkType().equals("vlan")) { + if ("vlan".equals(network.getProviderNetworkType())) { this.vlans.add(network.getProviderSegmentationId()); } } - else if (network.getSegments() != null && network.getSegments().size() > 0) { + else if (network.getSegments() != null && !network.getSegments().isEmpty()) { Segment s = network.getSegments().get(0); this.provider = s.getProviderPhysicalNetwork(); - if (s.getProviderNetworkType().equals("vlan")) { + if ("vlan".equals(s.getProviderNetworkType())) { for (Segment s1 : network.getSegments()) { this.vlans.add(s1.getProviderSegmentationId()); } -- cgit 1.2.3-korg