Fixed possible null point exception in node manager entries update code 28/29628/1
authorAnil Vishnoi <vishnoianil@gmail.com>
Fri, 13 Nov 2015 01:47:23 +0000 (07:17 +0530)
committerAnil Vishnoi <vishnoianil@gmail.com>
Fri, 13 Nov 2015 01:48:29 +0000 (01:48 +0000)
Change-Id: Iac231117e592f23c6e1362b71e76ae13d6c98a40
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstance.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommand.java

index aa232f171ecd91b171099fb71e25f8a46ec5a091..605f15f8f6b236337d2f161ca15aef06cb0ed0d3 100644 (file)
@@ -70,7 +70,6 @@ public class OvsdbConnectionInstance implements OvsdbClient {
     private TransactionInvoker txInvoker;
     private Map<DatabaseSchema,TransactInvoker> transactInvokers;
     private MonitorCallBack callback;
-    // private ConnectionInfo key;
     private InstanceIdentifier<Node> instanceIdentifier;
     private volatile boolean hasDeviceOwnership = false;
     private Entity connectedEntity;
index 73a70f818d5487eddb30eb87d909a11c03520f9e..735ae97251b141d348946aeb8e188b12140ca85a 100644 (file)
@@ -60,7 +60,7 @@ public class OvsdbNodeRemoveCommand extends AbstractTransactionCommand {
                             getOvsdbConnectionInstance().getInstanceIdentifier());
                 } else {
                     LOG.debug("Other southbound plugin instances in cluster are connected to the device,"
-                            + " not deleting OvsdbNode form data store.");
+                            + " not deleting OvsdbNode from operational data store.");
                 }
             }
         } catch (Exception e) {
@@ -86,13 +86,14 @@ public class OvsdbNodeRemoveCommand extends AbstractTransactionCommand {
             if (connectedManager == 0) {
                 return true;
             }
-        }
-        /*When switch is listening in passive mode, this number represent number of active connection to the device
-        This is to handle the controller initiated connection scenario, where all the controller will connect, but
-        switch will have only one manager.
-        */
-        if (onlyConnectedManager.getNumberOfConnections() > ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE) {
-            return false;
+
+            /*When switch is listening in passive mode, this number represent number of active connection to the device
+            This is to handle the controller initiated connection scenario, where all the controller will connect, but
+            switch will have only one manager.
+            */
+            if (onlyConnectedManager.getNumberOfConnections() > ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE) {
+                return false;
+            }
         }
         return true;
     }