Remove use StringUtils 75/79175/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 3 Jan 2019 13:20:24 +0000 (14:20 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 3 Jan 2019 13:20:24 +0000 (14:20 +0100)
Guava provides equivalent functionality, use that instead of
commons-lang3.

Change-Id: Ide5fb6606ea51d6a65518e5e57422b11c259d86a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactInvokerImpl.java

index dbef7467671fd7aa81ae207db447c76658f11f29..64cecc27cdf331ffca49295700f3257564bd135d 100644 (file)
@@ -7,13 +7,12 @@
  */
 package org.opendaylight.ovsdb.southbound.ovsdb.transact;
 
+import com.google.common.base.Strings;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.CancellationException;
 import java.util.concurrent.ExecutionException;
-
-import org.apache.commons.lang3.StringUtils;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.ovsdb.lib.operations.OperationResult;
 import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
@@ -50,7 +49,7 @@ public class TransactInvokerImpl implements TransactInvoker {
         invoke(command, tb);
     }
 
-    private void invoke(TransactCommand command, TransactionBuilder tb) {
+    private static void invoke(TransactCommand command, TransactionBuilder tb) {
         ListenableFuture<List<OperationResult>> result = tb.execute();
         LOG.debug("invoke: command: {}, tb: {}", command, tb);
         if (tb.getOperations().size() > 0) {
@@ -59,7 +58,7 @@ public class TransactInvokerImpl implements TransactInvoker {
                     List<OperationResult> got = result.get();
                     if (got != null) {
                         got.stream()
-                                .filter(response -> !StringUtils.isEmpty(response.getError()))
+                                .filter(response -> !Strings.isNullOrEmpty(response.getError()))
                                 .peek(response -> LOG.error("Failed to transact to device {}", response.getError()));
                     }
                     LOG.debug("OVSDB transaction result: {}", got);