Apply modernizations
[netconf.git] / netconf / mdsal-netconf-ssh / src / main / java / org / opendaylight / netconf / ssh / RemoteNetconfCommand.java
index 36313786b16b82552822c193d5b3ed9a06609375..b342bf7fd7a03874c962258d3ba18536d1b9a59c 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.netconf.ssh;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
@@ -122,9 +123,8 @@ public class RemoteNetconfCommand implements AsyncCommand, SessionAware {
             } else {
                 LOG.warn("Unable to establish internal connection to netconf server for client: {}",
                         getClientAddress());
-                Preconditions.checkNotNull(callback, "Exit callback must be set");
-                callback.onExit(1, "Unable to establish internal connection to netconf server for client: "
-                        + getClientAddress());
+                requireNonNull(callback, "Exit callback must be set").onExit(1,
+                    "Unable to establish internal connection to netconf server for client: " + getClientAddress());
             }
         });
     }