From: Anil Vishnoi Date: Fri, 13 Nov 2015 01:47:23 +0000 (+0530) Subject: Fixed possible null point exception in node manager entries update code X-Git-Tag: release/beryllium~195^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=b005df4bfdb3833d88fb12c1b7f063451bb7032b;p=ovsdb.git Fixed possible null point exception in node manager entries update code Change-Id: Iac231117e592f23c6e1362b71e76ae13d6c98a40 Signed-off-by: Anil Vishnoi --- diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstance.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstance.java index aa232f171..605f15f8f 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstance.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstance.java @@ -70,7 +70,6 @@ public class OvsdbConnectionInstance implements OvsdbClient { private TransactionInvoker txInvoker; private Map transactInvokers; private MonitorCallBack callback; - // private ConnectionInfo key; private InstanceIdentifier instanceIdentifier; private volatile boolean hasDeviceOwnership = false; private Entity connectedEntity; diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommand.java index 73a70f818..735ae9725 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommand.java @@ -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; }