From eb0eab0a8644bf74f40f7f0be6bd8da1d09bb119 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Thu, 16 Dec 2010 20:42:22 +0000 Subject: [PATCH] Code clean-ups git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1050152 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/conn/routing/RouteTracker.java | 31 +++++++------------ .../impl/client/DefaultRequestDirector.java | 17 ++++------ 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/conn/routing/RouteTracker.java b/httpclient/src/main/java/org/apache/http/conn/routing/RouteTracker.java index 86ada48ba..dcf227d77 100644 --- a/httpclient/src/main/java/org/apache/http/conn/routing/RouteTracker.java +++ b/httpclient/src/main/java/org/apache/http/conn/routing/RouteTracker.java @@ -294,7 +294,7 @@ public final class RouteTracker implements RouteInfo, Cloneable { return false; RouteTracker that = (RouteTracker) o; - return + return // Do the cheapest checks first (this.connected == that.connected) && (this.secure == that.secure) && @@ -315,26 +315,19 @@ public final class RouteTracker implements RouteInfo, Cloneable { */ @Override public final int hashCode() { - - int hc = this.targetHost.hashCode(); - - if (this.localAddress != null) - hc ^= localAddress.hashCode(); + int hash = LangUtils.HASH_SEED; + hash = LangUtils.hashCode(hash, this.targetHost); + hash = LangUtils.hashCode(hash, this.localAddress); if (this.proxyChain != null) { - hc ^= proxyChain.length; - for (int i=0; i HttpRouteDirector.COMPLETE); @@ -945,8 +941,7 @@ public class DefaultRequestDirector implements RequestDirector { // complexity. Feel free to submit patches that refactor the code in // createTunnelToTarget to facilitate re-use for proxy tunnelling. - throw new UnsupportedOperationException - ("Proxy chains are not supported."); + throw new HttpException("Proxy chains are not supported."); }