[hotfix] [network] Minor code cleanup in NettyTestUtil
Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/10c9f879 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/10c9f879 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/10c9f879 Branch: refs/heads/master Commit: 10c9f879e8217da9aceb7bcb527c34a417fc3689 Parents: 908cf93 Author: Stephan Ewen <[email protected]> Authored: Wed May 9 12:27:19 2018 +0200 Committer: Stephan Ewen <[email protected]> Committed: Sun May 13 13:41:28 2018 +0200 ---------------------------------------------------------------------- .../runtime/io/network/netty/NettyTestUtil.java | 29 +++++++------------- 1 file changed, 10 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/10c9f879/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java index f664347..f0c1b80 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java @@ -21,7 +21,6 @@ package org.apache.flink.runtime.io.network.netty; import org.apache.flink.configuration.Configuration; import org.apache.flink.util.NetUtils; -import scala.Tuple2; import org.apache.flink.shaded.netty4.io.netty.channel.Channel; import java.net.InetAddress; @@ -36,7 +35,7 @@ import static org.apache.flink.util.Preconditions.checkNotNull; */ public class NettyTestUtil { - static int DEFAULT_SEGMENT_SIZE = 1024; + static final int DEFAULT_SEGMENT_SIZE = 1024; // --------------------------------------------------------------------------------------------- // NettyServer and NettyClient @@ -145,32 +144,24 @@ public class NettyTestUtil { config); } - // --------------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------ - static class NettyServerAndClient extends Tuple2<NettyServer, NettyClient> { + static final class NettyServerAndClient { - private static final long serialVersionUID = 4440278728496341931L; + private final NettyServer server; + private final NettyClient client; - NettyServerAndClient(NettyServer _1, NettyClient _2) { - super(_1, _2); + NettyServerAndClient(NettyServer server, NettyClient client) { + this.server = checkNotNull(server); + this.client = checkNotNull(client); } NettyServer server() { - return _1(); + return server; } NettyClient client() { - return _2(); - } - - @Override - public boolean canEqual(Object that) { - return false; - } - - @Override - public boolean equals(Object that) { - return false; + return client; } } }
