Merge "Revert "Bug 6745 Do not ignore syncup return value""
[openflowplugin.git] / applications / forwardingrules-sync / src / main / java / org / opendaylight / openflowplugin / applications / frsync / impl / SyncReactorFutureZipDecorator.java
index 4393b05d8f846db1b07b2e4f7c7921212fd34e46..f6301dc4f13bb23679843727597b5858a7878d79 100644 (file)
@@ -19,8 +19,6 @@ import org.opendaylight.openflowplugin.applications.frsync.SyncReactor;
 import org.opendaylight.openflowplugin.applications.frsync.util.SyncupEntry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Enriches {@link SyncReactorFutureDecorator} with state compression.
@@ -31,7 +29,7 @@ public class SyncReactorFutureZipDecorator extends SyncReactorFutureDecorator {
     private final Map<InstanceIdentifier<FlowCapableNode>, SyncupEntry> compressionQueue = new HashMap<>();
     private final Semaphore compressionGuard = new Semaphore(1, true);
 
-    public SyncReactorFutureZipDecorator(SyncReactor delegate, ListeningExecutorService executorService) {
+    public SyncReactorFutureZipDecorator(final SyncReactor delegate, final ListeningExecutorService executorService) {
         super(delegate, executorService);
     }
 
@@ -41,10 +39,9 @@ public class SyncReactorFutureZipDecorator extends SyncReactorFutureDecorator {
             compressionGuard.acquire();
             final boolean newTaskNecessary = updateCompressionState(flowcapableNodePath, syncupEntry);
             if (newTaskNecessary) {
-                return super.syncup(flowcapableNodePath, syncupEntry);
-            } else {
-                return Futures.immediateFuture(Boolean.TRUE);
+                super.syncup(flowcapableNodePath, syncupEntry);
             }
+            return Futures.immediateFuture(Boolean.TRUE);
         } finally {
             compressionGuard.release();
         }