Fix findbugs violations in applications
[openflowplugin.git] / applications / forwardingrules-sync / src / main / java / org / opendaylight / openflowplugin / applications / frsync / impl / SyncReactorRetryDecorator.java
index 2460cb121de46a328dec7ad6110d7d8d18ff5843..102e37000052d2266851388167f324188c39cb11 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
-import com.google.common.base.Function;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -36,6 +35,7 @@ public class SyncReactorRetryDecorator implements SyncReactor {
         this.reconciliationRegistry = reconciliationRegistry;
     }
 
+    @Override
     public ListenableFuture<Boolean> syncup(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
                                             final SyncupEntry syncupEntry) {
 
@@ -47,16 +47,14 @@ public class SyncReactorRetryDecorator implements SyncReactor {
 
         ListenableFuture<Boolean> syncupResult = delegate.syncup(flowcapableNodePath,syncupEntry);
 
-        return Futures.transform(syncupResult, new Function<Boolean, Boolean>() {
-            @Override
-            public Boolean apply(Boolean result) {
-                if (result) {
-                    reconciliationRegistry.unregisterIfRegistered(nodeId);
-                } else {
-                    reconciliationRegistry.register(nodeId);
-                }
-                return result;
+        return Futures.transform(syncupResult, result -> {
+            if (result) {
+                reconciliationRegistry.unregisterIfRegistered(nodeId);
+            } else {
+                reconciliationRegistry.register(nodeId);
             }
+
+            return result;
         }, MoreExecutors.directExecutor());
     }
 }