Bump upstreams
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / connection / listener / HandshakeListenerImpl.java
index f087f27440b11acc96f05395a9d9e891d96354bd..db894575883b8dde4a41fbe65eaa8ac7d0e45f27 100644 (file)
@@ -29,13 +29,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class HandshakeListenerImpl implements HandshakeListener {
-
     private static final Logger LOG = LoggerFactory.getLogger(HandshakeListenerImpl.class);
     private static final Logger OF_EVENT_LOG = LoggerFactory.getLogger("OfEventLog");
 
     private final ConnectionContext connectionContext;
     private final DeviceConnectedHandler deviceConnectedHandler;
-    private HandshakeContext handshakeContext;
+
+    private HandshakeContext handshakeContext = null;
 
     /**
      * Constructor.
@@ -55,7 +55,7 @@ public class HandshakeListenerImpl implements HandshakeListener {
             LOG.debug("handshake succeeded: {}", connectionContext.getConnectionAdapter().getRemoteAddress());
         }
         OF_EVENT_LOG.debug("Connect, Node: {}", featureOutput.getDatapathId());
-        this.handshakeContext.close();
+        handshakeContext.close();
         connectionContext.changeStateToWorking();
         connectionContext.setFeatures(featureOutput);
         connectionContext.setNodeId(InventoryDataServiceUtil.nodeIdFromDatapathId(featureOutput.getDatapathId()));
@@ -104,16 +104,16 @@ public class HandshakeListenerImpl implements HandshakeListener {
                 .setXid(xid)
                 .setVersion(version)
                 .build();
-        return this.connectionContext.getConnectionAdapter().barrier(barrierInput);
+        return connectionContext.getConnectionAdapter().barrier(barrierInput);
     }
 
     @Override
     public void onHandshakeFailure() {
         if (LOG.isDebugEnabled()) {
-            LOG.debug("handshake failed: {}", this.connectionContext.getConnectionAdapter().getRemoteAddress());
+            LOG.debug("handshake failed: {}", connectionContext.getConnectionAdapter().getRemoteAddress());
         }
-        this.handshakeContext.close();
-        this.connectionContext.closeConnection(false);
+        handshakeContext.close();
+        connectionContext.closeConnection(false);
     }
 
     @Override