Fix issue found by sonar: Method call on object which may be null 67/12467/1
authorFlavio Fernandes <ffernand@redhat.com>
Mon, 3 Nov 2014 18:31:21 +0000 (13:31 -0500)
committerFlavio Fernandes <ffernand@redhat.com>
Mon, 3 Nov 2014 18:31:21 +0000 (13:31 -0500)
Change-Id: I937dddbe08fa12cbe38ad01a5990a90c4ac19df1
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
ovs-sfc/src/main/java/org/opendaylight/ovsdb/ovssfc/OvsUtils.java

index 7bbf9a5c3328697c3528d7a361c3cf75ef35115b..25a73e674418ca19af128c2d3c2f9ae0e631c9d0 100644 (file)
@@ -158,7 +158,7 @@ public class OvsUtils {
                     .getRow(ovsNode, ovsdbConfigurationService.getTableName(ovsNode, Bridge.class), bridgeUuid);
             Bridge bridge = ovsdbConfigurationService.getTypedRow(ovsNode, Bridge.class, bridgeRow);
             Set<String> dpids = bridge.getDatapathIdColumn().getData();
-            if (dpids != null || dpids.size() != 0) {
+            if (dpids != null && !dpids.isEmpty()) {
                 dpid = HexEncode.stringToLong((String) dpids.toArray()[0]);
             }
         } catch (Exception e) {