diff options
author | shashikanth <shashikanth.vh@huawei.com> | 2017-09-26 19:02:24 +0530 |
---|---|---|
committer | shashikanth <shashikanth.vh@huawei.com> | 2017-09-26 19:02:24 +0530 |
commit | 7869c1c81cdb575f1d3e59f21951226b38f02418 (patch) | |
tree | 5204e32e5d6ba5ea967f6414b393afadad8c14e4 /adapters/mso-adapter-utils/src/main/java/org | |
parent | 00f6a9c613096e3d4623b8e8486992be727d92da (diff) |
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 <shashikanth.vh@huawei.com>
Diffstat (limited to 'adapters/mso-adapter-utils/src/main/java/org')
-rw-r--r-- | adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/beans/NetworkInfo.java | 12 |
1 files changed, 6 insertions, 6 deletions
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<Integer> vlans = new ArrayList<Integer>(); - private List<String> subnets = new ArrayList<String>(); + private List<Integer> vlans = new ArrayList<>(); + private List<String> subnets = new ArrayList<>(); private String shared = ""; static Map<String,NetworkStatus> NetworkStatusMap; static { - NetworkStatusMap = new HashMap<String,NetworkStatus>(); + 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()); } |