From 6a8345e04520ce590dd59c8a962f713f62af4954 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sat, 16 Feb 2019 16:20:20 -0500 Subject: [PATCH] Forgot to include equals/hashCode on the object key --- .../proxy/network/http/NettyHttpClient.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/network/http/NettyHttpClient.java b/proxy/src/main/java/com/velocitypowered/proxy/network/http/NettyHttpClient.java index f3733ce51..9314f29f5 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/network/http/NettyHttpClient.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/network/http/NettyHttpClient.java @@ -19,6 +19,7 @@ import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslHandler; import java.net.InetSocketAddress; import java.net.URL; +import java.util.Objects; import java.util.concurrent.CompletableFuture; import javax.net.ssl.SSLEngine; @@ -119,5 +120,31 @@ public class NettyHttpClient { this.address = address; this.ssl = ssl; } + + @Override + public String toString() { + return "HostAndSsl{" + + "address=" + address + + ", ssl=" + ssl + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HostAndSsl that = (HostAndSsl) o; + return ssl == that.ssl + && Objects.equals(address, that.address); + } + + @Override + public int hashCode() { + return Objects.hash(address, ssl); + } } }