protocol-framework: use lambdas
[controller.git] / opendaylight / commons / protocol-framework / src / main / java / org / opendaylight / protocol / framework / TimedReconnectStrategy.java
index ed60abb05adb9f25e92fe751a4e8162c531da458..6a1607803b9310c1a1a5a43013ff2906b38b7290 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.protocol.framework;
 import io.netty.util.concurrent.EventExecutor;
 import io.netty.util.concurrent.Future;
 
 import io.netty.util.concurrent.EventExecutor;
 import io.netty.util.concurrent.Future;
 
-import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
@@ -129,16 +128,13 @@ public final class TimedReconnectStrategy implements ReconnectStrategy {
         this.scheduled = true;
 
         // Schedule a task for the right time. It will also clear the flag.
         this.scheduled = true;
 
         // Schedule a task for the right time. It will also clear the flag.
-        return this.executor.schedule(new Callable<Void>() {
-            @Override
-            public Void call() throws TimeoutException {
-                synchronized (lock) {
-                    Preconditions.checkState(TimedReconnectStrategy.this.scheduled);
-                    TimedReconnectStrategy.this.scheduled = false;
-                }
-
-                return null;
+        return this.executor.schedule(() -> {
+            synchronized (lock) {
+                Preconditions.checkState(TimedReconnectStrategy.this.scheduled);
+                TimedReconnectStrategy.this.scheduled = false;
             }
             }
+
+            return null;
         }, this.lastSleep, TimeUnit.MILLISECONDS);
     }
 
         }, this.lastSleep, TimeUnit.MILLISECONDS);
     }