Bump odlparent to 5.0.0
[openflowplugin.git] / applications / forwardingrules-sync / src / main / java / org / opendaylight / openflowplugin / applications / frsync / util / FxChainUtil.java
index 5e02d48a39d8aedbfe626282b07aea6dfc6f4d17..3da1068e0bb81fc870807ba73a0dabad997d72e4 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -11,9 +11,7 @@ package org.opendaylight.openflowplugin.applications.frsync.util;
 import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.FutureCallback;
-import java.util.Arrays;
 import java.util.Collection;
-import javax.annotation.Nullable;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -23,7 +21,7 @@ import org.slf4j.LoggerFactory;
 /**
  * Util methods for {@link com.google.common.util.concurrent.ListenableFuture} chaining.
  */
-public class FxChainUtil {
+public final class FxChainUtil {
 
     private static final Logger LOG = LoggerFactory.getLogger(FxChainUtil.class);
 
@@ -35,22 +33,23 @@ public class FxChainUtil {
     public static FutureCallback<RpcResult<Void>> logResultCallback(final NodeId nodeId, final String prefix) {
         return new FutureCallback<RpcResult<Void>>() {
             @Override
-            public void onSuccess(@Nullable final RpcResult<Void> result) {
+            public void onSuccess(final RpcResult<Void> result) {
                 if (result != null) {
                     if (result.isSuccessful()) {
-                        LOG.debug(prefix + " finished successfully: {}", nodeId.getValue());
+                        LOG.debug("{} finished successfully: {}", prefix, nodeId.getValue());
                     } else {
-                        final Collection<RpcError> errors = MoreObjects.firstNonNull(result.getErrors(), ImmutableList.<RpcError>of());
-                        LOG.debug(prefix + " failed: {} -> {}", nodeId.getValue(), Arrays.toString(errors.toArray()));
+                        final Collection<RpcError> errors = MoreObjects.firstNonNull(result.getErrors(),
+                                ImmutableList.of());
+                        LOG.debug("{} failed: {} -> {}", prefix, nodeId.getValue(), errors);
                     }
                 } else {
-                    LOG.debug(prefix + " reconciliation failed: {} -> null result", nodeId.getValue());
+                    LOG.debug("{} reconciliation failed: {} -> null result", prefix, nodeId.getValue());
                 }
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                LOG.debug(prefix + " reconciliation failed seriously: {}", nodeId.getValue(), t);
+            public void onFailure(final Throwable failure) {
+                LOG.debug("{} reconciliation failed seriously: {}", prefix, nodeId.getValue(), failure);
             }
         };
     }