From 9b6aeffa80e236a299f0c1e0967ca2dc14c84234 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Wed, 5 Dec 2012 12:17:39 +0000 Subject: [PATCH] Fixed binary compatiblity breakage git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1417377 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/http/impl/client/AbstractHttpClient.java | 2 +- .../http/impl/client/CloseableHttpClient.java | 13 ++++++++++--- .../impl/client/builder/InternalHttpClient.java | 2 +- 3 files changed, 12 insertions(+), 5 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 171565d40..70e61ca60 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 @@ -777,7 +777,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { } @Override - public final CloseableHttpResponse execute(HttpHost target, HttpRequest request, + protected final CloseableHttpResponse doExecute(HttpHost target, HttpRequest request, HttpContext context) throws IOException, ClientProtocolException { diff --git a/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java index cca2ab4e3..3be2153aa 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java @@ -58,16 +58,23 @@ public abstract class CloseableHttpClient implements HttpClient, Closeable { private final Log log = LogFactory.getLog(getClass()); - public abstract CloseableHttpResponse execute(HttpHost target, HttpRequest request, + protected abstract CloseableHttpResponse doExecute(HttpHost target, HttpRequest request, HttpContext context) throws IOException, ClientProtocolException; + public CloseableHttpResponse execute( + final HttpHost target, + final HttpRequest request, + final HttpContext context) throws IOException, ClientProtocolException { + return doExecute(target, request, context); + } + public CloseableHttpResponse execute( final HttpUriRequest request, final HttpContext context) throws IOException, ClientProtocolException { if (request == null) { throw new IllegalArgumentException("Request must not be null."); } - return execute(determineTarget(request), request, context); + return doExecute(determineTarget(request), request, context); } private static HttpHost determineTarget(HttpUriRequest request) throws ClientProtocolException { @@ -94,7 +101,7 @@ public abstract class CloseableHttpClient implements HttpClient, Closeable { public CloseableHttpResponse execute( final HttpHost target, final HttpRequest request) throws IOException, ClientProtocolException { - return execute(target, request, (HttpContext) null); + return doExecute(target, request, (HttpContext) null); } public T execute(final HttpUriRequest request, diff --git a/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java index df79daa5c..311efcf89 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java @@ -150,7 +150,7 @@ class InternalHttpClient extends CloseableHttpClient { } @Override - public CloseableHttpResponse execute( + protected CloseableHttpResponse doExecute( final HttpHost target, final HttpRequest request, final HttpContext context) throws IOException, ClientProtocolException {