diff --git a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoute.java b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoute.java index dbb96f1f3..57d45041a 100644 --- a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoute.java +++ b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoute.java @@ -30,6 +30,7 @@ import java.net.InetAddress; import org.apache.http.annotation.Immutable; +import org.apache.http.util.LangUtils; import org.apache.http.HttpHost; @@ -329,35 +330,17 @@ public final boolean isSecure() { * false */ @Override - public final boolean equals(Object o) { - if (o == this) - return true; - if (!(o instanceof HttpRoute)) - return false; - - HttpRoute that = (HttpRoute) o; - - if ( - this.targetHost.equals(that.targetHost) && - ( ( this.localAddress == that.localAddress) || - (( this.localAddress != null) && - this.localAddress.equals(that.localAddress)) - ) && - ( ( this.proxyChain == that.proxyChain) || - ( this.proxyChain.length == that.proxyChain.length) - // comparison of actual proxies follows below - ) && - (this.secure == that.secure) && - (this.tunnelled == that.tunnelled) && - (this.layered == that.layered) - ) { - boolean equal = true; - // chain length has been compared above, now check the proxies - if (this.proxyChain != null) { - for (int i=0; equal && (i