From 5fefbfaa1bdb1db1beb1149ef2c868ec56471018 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Wed, 25 Nov 2009 20:13:14 +0000 Subject: [PATCH] Fixed binary compatibility breakage git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@884245 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/http/impl/client/AbstractHttpClient.java | 13 +++---------- .../apache/http/impl/client/DefaultHttpClient.java | 11 +---------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java index 129fed749..0a27094d3 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java @@ -130,8 +130,6 @@ import org.apache.http.protocol.ImmutableHttpProcessor; *
  • {@link RedirectStrategy}
  • object used to determine if an HTTP * request should be redirected to a new location in response to an HTTP * response received from the target server. - * The {@link #createRedirectStrategy()} must be implemented - * by concrete super classes to instantiate this object. *
  • {@link UserTokenHandler}
  • object used to determine if the * execution context is user identity specific. * The {@link #createUserTokenHandler()} must be implemented by @@ -273,11 +271,6 @@ public abstract class AbstractHttpClient implements HttpClient { @Deprecated protected abstract org.apache.http.client.RedirectHandler createRedirectHandler(); - /** - * @since 4.1 - */ - protected abstract RedirectStrategy createRedirectStrategy(); - protected abstract AuthenticationHandler createTargetAuthenticationHandler(); @@ -296,7 +289,6 @@ public abstract class AbstractHttpClient implements HttpClient { protected abstract UserTokenHandler createUserTokenHandler(); - // non-javadoc, see interface HttpClient public synchronized final HttpParams getParams() { if (defaultParams == null) { @@ -412,9 +404,10 @@ public abstract class AbstractHttpClient implements HttpClient { /** * @since 4.1 */ + @SuppressWarnings("deprecation") public synchronized final RedirectStrategy getRedirectStrategy() { if (redirectStrategy == null) { - redirectStrategy = createRedirectStrategy(); + redirectStrategy = new DefaultRedirectStrategyAdaptor(createRedirectHandler()); } return redirectStrategy; } @@ -685,7 +678,7 @@ public abstract class AbstractHttpClient implements HttpClient { getRoutePlanner(), getProtocolProcessor(), getHttpRequestRetryHandler(), - getRedirectHandler(), + getRedirectStrategy(), getTargetAuthenticationHandler(), getProxyAuthenticationHandler(), getUserTokenHandler(), diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java index 09b9eae18..6ec6b75ca 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java @@ -36,7 +36,6 @@ import org.apache.http.client.AuthenticationHandler; import org.apache.http.client.CookieStore; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.HttpRequestRetryHandler; -import org.apache.http.client.RedirectStrategy; import org.apache.http.client.UserTokenHandler; import org.apache.http.client.params.AuthPolicy; import org.apache.http.client.params.ClientPNames; @@ -165,6 +164,7 @@ public class DefaultHttpClient extends AbstractHttpClient { final ClientConnectionManager conman, final HttpParams params) { super(conman, params); + setRedirectStrategy(new DefaultRedirectStrategy()); } @@ -357,15 +357,6 @@ public class DefaultHttpClient extends AbstractHttpClient { return new DefaultRedirectHandler(); } - /** - * @since 4.1 - */ - @Override - protected RedirectStrategy createRedirectStrategy() { - return new DefaultRedirectStrategy(); - } - - @Override protected AuthenticationHandler createTargetAuthenticationHandler() { return new DefaultTargetAuthenticationHandler();