Fix a sonar complaint
[mdsal.git] / replicate / mdsal-replicate-netty / src / main / java / org / opendaylight / mdsal / replicate / netty / SinkSingletonService.java
index 98e154e3d8f7a6f58983474d4552c7316c09f3d0..02aa97eb3c9b8b7e24593345a85c5c6cc33b1e53 100644 (file)
@@ -170,14 +170,10 @@ final class SinkSingletonService extends ChannelInitializer<SocketChannel> imple
     }
 
     private synchronized void channelClosed(final ChannelFuture completedFuture, final ScheduledExecutorService group) {
-        if (futureChannel != null && futureChannel.channel() == completedFuture.channel()) {
-            if (!closingInstance) {
-                LOG.info("Channel {} lost connection to source {}, reconnecting in {}", completedFuture.channel(),
-                    sourceAddress, reconnectDelay.getSeconds());
-                group.schedule(() -> {
-                    reconnect();
-                }, reconnectDelay.toNanos(), TimeUnit.NANOSECONDS);
-            }
+        if (futureChannel != null && futureChannel.channel() == completedFuture.channel() && !closingInstance) {
+            LOG.info("Channel {} lost connection to source {}, reconnecting in {}", completedFuture.channel(),
+                sourceAddress, reconnectDelay.getSeconds());
+            group.schedule(this::reconnect, reconnectDelay.toNanos(), TimeUnit.NANOSECONDS);
         }
     }