Change collections size with isEmpty 88/93288/1
authorsindhu3672 <arcot.sindhuri@huawei.com>
Mon, 12 Aug 2019 05:40:32 +0000 (11:10 +0530)
committersindhu3672 <arcot.sindhuri@huawei.com>
Mon, 12 Aug 2019 05:40:32 +0000 (11:10 +0530)
Change collections size with isEmpty mso-adapter-utils class

Issue-ID: SO-2187

Signed-off-by: sindhu3672 <arcot.sindhuri@huawei.com>
Change-Id: I784a5839d003c42a9880287d304060cd9639f1b6

adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java

index 069c6c7..44fc620 100644 (file)
@@ -130,13 +130,13 @@ public class MsoNeutronUtils extends MsoCommonUtils {
         network.setAdminStateUp(true);
 
         if (type == NetworkType.PROVIDER) {
-            if (provider != null && vlans != null && vlans.size() > 0) {
+            if (provider != null && vlans != null && !vlans.isEmpty()) {
                 network.setProviderPhysicalNetwork(provider);
                 network.setProviderNetworkType("vlan");
                 network.setProviderSegmentationId(vlans.get(0));
             }
         } else if (type == NetworkType.MULTI_PROVIDER) {
-            if (provider != null && vlans != null && vlans.size() > 0) {
+            if (provider != null && vlans != null && !vlans.isEmpty()) {
                 List<Segment> segments = new ArrayList<>(vlans.size());
                 for (int vlan : vlans) {
                     Segment segment = new Segment();