From 7ae0a8ac5f31d3b9f5bb54b920a32bcbb0452a32 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Thu, 19 Jun 2014 07:52:25 +0000 Subject: [PATCH] Fixed binary incompatibility with 4.3 git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1603744 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/impl/client/AbstractResponseHandler.java | 2 +- .../http/impl/client/BasicResponseHandler.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AbstractResponseHandler.java b/httpclient/src/main/java/org/apache/http/impl/client/AbstractResponseHandler.java index e87ac11cf..1f5d0fe3d 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/AbstractResponseHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/AbstractResponseHandler.java @@ -59,7 +59,7 @@ public abstract class AbstractResponseHandler implements ResponseHandler { * status code), throws an {@link HttpResponseException}. */ @Override - public final T handleResponse(final HttpResponse response) + public T handleResponse(final HttpResponse response) throws HttpResponseException, IOException { final StatusLine statusLine = response.getStatusLine(); final HttpEntity entity = response.getEntity(); diff --git a/httpclient/src/main/java/org/apache/http/impl/client/BasicResponseHandler.java b/httpclient/src/main/java/org/apache/http/impl/client/BasicResponseHandler.java index 2c8a8a786..338424157 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/BasicResponseHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/BasicResponseHandler.java @@ -30,17 +30,19 @@ package org.apache.http.impl.client; import java.io.IOException; import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; import org.apache.http.annotation.Immutable; +import org.apache.http.client.HttpResponseException; import org.apache.http.util.EntityUtils; /** - * A {@link ResponseHandler} that returns the response body as a String + * A {@link org.apache.http.client.ResponseHandler} that returns the response body as a String * for successful (2xx) responses. If the response code was >= 300, the response - * body is consumed and an {@link HttpResponseException} is thrown. + * body is consumed and an {@link org.apache.http.client.HttpResponseException} is thrown. *

* If this is used with * {@link org.apache.http.client.HttpClient#execute( - * org.apache.http.client.methods.HttpUriRequest, ResponseHandler)}, + * org.apache.http.client.methods.HttpUriRequest, org.apache.http.client.ResponseHandler)}, * HttpClient may handle redirects (3xx responses) internally. * * @since 4.0 @@ -56,4 +58,10 @@ public class BasicResponseHandler extends AbstractResponseHandler { return EntityUtils.toString(entity); } + @Override + public String handleResponse( + final HttpResponse response) throws HttpResponseException, IOException { + return super.handleResponse(response); + } + }