Merge remote-tracking branch 'liblldp/master'
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / singlelayer / SingleLayerTableMultipartService.java
index 1818f6cf4f788f48cd8b803b560f861328b7a462..567213447fe393aba980d194ac6f4c2666964a1f 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.openflowplugin.impl.services.singlelayer;
 
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import java.math.BigInteger;
 import java.util.List;
@@ -64,6 +65,7 @@ public class SingleLayerTableMultipartService extends AbstractTableMultipartServ
 
         Futures.addCallback(handleServiceCall(input), new FutureCallback<RpcResult<List<MultipartReply>>>() {
             @Override
+            @SuppressWarnings("checkstyle:IllegalCatch")
             public void onSuccess(final RpcResult<List<MultipartReply>> result) {
                 if (result.isSuccessful()) {
                     final List<MultipartReply> multipartReplies = result.getResult();
@@ -74,7 +76,8 @@ public class SingleLayerTableMultipartService extends AbstractTableMultipartServ
                     } else {
                         finalFuture.set(RpcResultBuilder
                             .success(new UpdateTableOutputBuilder()
-                                .setTransactionId(new TransactionId(BigInteger.valueOf(multipartReplies.get(0).getXid())))
+                                .setTransactionId(
+                                        new TransactionId(BigInteger.valueOf(multipartReplies.get(0).getXid())))
                                 .build())
                             .build());
 
@@ -93,21 +96,21 @@ public class SingleLayerTableMultipartService extends AbstractTableMultipartServ
                         }
                     }
                 } else {
-                    LOG.debug("OnSuccess, rpc result unsuccessful, multipart response for rpc update-table was unsuccessful.");
+                    LOG.debug("OnSuccess, rpc result unsuccessful,"
+                            + " multipart response for rpc update-table was unsuccessful.");
                     finalFuture.set(RpcResultBuilder.<UpdateTableOutput>failed().withRpcErrors(result.getErrors())
                         .build());
                 }
             }
 
             @Override
-            public void onFailure(Throwable t) {
-                LOG.error("Failure multipart response for table features request. Exception: {}", t);
+            public void onFailure(Throwable throwable) {
+                LOG.error("Failure multipart response for table features request. Exception: {}", throwable);
                 finalFuture.set(RpcResultBuilder.<UpdateTableOutput>failed()
-                    .withError(ErrorType.RPC, "Future error", t).build());
+                    .withError(ErrorType.RPC, "Future error", throwable).build());
             }
-        });
+        }, MoreExecutors.directExecutor());
 
         return finalFuture;
     }
-
 }
\ No newline at end of file