From fdfd59534c3290f3c72bf527a230f9b8726b0a73 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Tue, 6 Nov 2012 21:52:35 +0000 Subject: [PATCH] Add missing @Override and @Deprecated annotations. git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1406359 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/http/conn/BasicManagedEntity.java | 3 ++- .../org/apache/http/conn/params/ConnConnectionPNames.java | 3 ++- .../apache/http/conn/params/ConnConnectionParamBean.java | 3 ++- .../java/org/apache/http/conn/params/ConnManagerParams.java | 6 ++++-- .../java/org/apache/http/conn/ssl/SSLSocketFactory.java | 3 ++- .../java/org/apache/http/impl/auth/NegotiateScheme.java | 3 ++- .../org/apache/http/impl/client/AbstractHttpClient.java | 3 ++- .../org/apache/http/impl/client/AutoRetryHttpClient.java | 1 + .../http/impl/client/DefaultHttpRequestRetryHandler.java | 3 ++- .../apache/http/impl/client/builder/InternalHttpClient.java | 3 ++- .../apache/http/impl/conn/AbstractClientConnAdapter.java | 3 ++- .../apache/http/impl/conn/AbstractPooledConnAdapter.java | 6 ++++-- .../org/apache/http/impl/conn/DefaultResponseParser.java | 1 + .../org/apache/http/impl/conn/SingleClientConnManager.java | 3 ++- .../org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java | 3 ++- .../org/apache/http/impl/conn/tsccm/RouteSpecificPool.java | 3 ++- .../http/impl/conn/tsccm/ThreadSafeClientConnManager.java | 6 ++++-- 17 files changed, 38 insertions(+), 18 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java b/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java index 7f44781e0..b605dbe13 100644 --- a/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java +++ b/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java @@ -110,7 +110,8 @@ public class BasicManagedEntity extends HttpEntityWrapper /** * @deprecated (4.1) Use {@link EntityUtils#consume(HttpEntity)} */ - @Override + @Deprecated + @Override public void consumeContent() throws IOException { ensureConsumed(); } diff --git a/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionPNames.java b/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionPNames.java index a6d66b00f..c43e6d1e7 100644 --- a/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionPNames.java +++ b/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionPNames.java @@ -55,7 +55,8 @@ public interface ConnConnectionPNames { * * @deprecated Use custom {@link DefaultHttpResponseParser} implementation */ - public static final String MAX_STATUS_LINE_GARBAGE = "http.connection.max-status-line-garbage"; + @Deprecated + public static final String MAX_STATUS_LINE_GARBAGE = "http.connection.max-status-line-garbage"; } diff --git a/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionParamBean.java b/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionParamBean.java index eac4c5209..54cf766d3 100644 --- a/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionParamBean.java +++ b/httpclient/src/main/java/org/apache/http/conn/params/ConnConnectionParamBean.java @@ -50,7 +50,8 @@ public class ConnConnectionParamBean extends HttpAbstractParamBean { /** * @deprecated (4.2) Use custom {@link DefaultHttpResponseParser} implementation */ - public void setMaxStatusLineGarbage (final int maxStatusLineGarbage) { + @Deprecated + public void setMaxStatusLineGarbage (final int maxStatusLineGarbage) { params.setIntParameter(ConnConnectionPNames.MAX_STATUS_LINE_GARBAGE, maxStatusLineGarbage); } diff --git a/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerParams.java b/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerParams.java index bcb9a2d62..95725ed7f 100644 --- a/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerParams.java +++ b/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerParams.java @@ -58,7 +58,8 @@ public final class ConnManagerParams implements ConnManagerPNames { * * @deprecated (4.1) use {@link HttpConnectionParams#getConnectionTimeout(HttpParams)} */ - public static long getTimeout(final HttpParams params) { + @Deprecated + public static long getTimeout(final HttpParams params) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); } @@ -74,7 +75,8 @@ public final class ConnManagerParams implements ConnManagerPNames { * * @deprecated (4.1) use {@link HttpConnectionParams#setConnectionTimeout(HttpParams, int)} */ - public static void setTimeout(final HttpParams params, long timeout) { + @Deprecated + public static void setTimeout(final HttpParams params, long timeout) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); } diff --git a/httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java b/httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java index 644b196e3..94a4aea4f 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java +++ b/httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java @@ -634,7 +634,8 @@ public class SSLSocketFactory implements SchemeLayeredSocketFactory, /** * @deprecated use {@link #createLayeredSocket(Socket, String, int, HttpParams)} */ - public Socket createLayeredSocket( + @Deprecated + public Socket createLayeredSocket( final Socket socket, final String host, final int port, diff --git a/httpclient/src/main/java/org/apache/http/impl/auth/NegotiateScheme.java b/httpclient/src/main/java/org/apache/http/impl/auth/NegotiateScheme.java index 463e961bf..68559502f 100644 --- a/httpclient/src/main/java/org/apache/http/impl/auth/NegotiateScheme.java +++ b/httpclient/src/main/java/org/apache/http/impl/auth/NegotiateScheme.java @@ -81,7 +81,8 @@ public class NegotiateScheme extends GGSSchemeBase { return "Negotiate"; } - public Header authenticate( + @Override + public Header authenticate( final Credentials credentials, final HttpRequest request) throws AuthenticationException { return authenticate(credentials, request, null); 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 7968a82a3..171565d40 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 @@ -776,7 +776,8 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { protocolProcessor = null; } - public final CloseableHttpResponse execute(HttpHost target, HttpRequest request, + @Override + public final CloseableHttpResponse execute(HttpHost target, HttpRequest request, HttpContext context) throws IOException, ClientProtocolException { diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java index 34118a641..36ce0d8ab 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java @@ -55,6 +55,7 @@ import org.apache.http.util.EntityUtils; * * @deprecated (4.3) use {@link HttpClientBuilder}. */ +@Deprecated @ThreadSafe public class AutoRetryHttpClient implements HttpClient { diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java index 538b0cdbe..407b78799 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java @@ -159,7 +159,8 @@ public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler { * * @deprecated (4.3) */ - protected boolean requestIsAborted(final HttpRequest request) { + @Deprecated + protected boolean requestIsAborted(final HttpRequest request) { HttpRequest req = request; if (request instanceof RequestWrapper) { // does not forward request to original req = ((RequestWrapper) request).getOriginal(); 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 0ec3579d1..96b82b795 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 @@ -143,7 +143,8 @@ class InternalHttpClient extends CloseableHttpClient { return context; } - public CloseableHttpResponse execute( + @Override + public CloseableHttpResponse execute( final HttpHost target, final HttpRequest request, final HttpContext context) throws IOException, ClientProtocolException { diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/AbstractClientConnAdapter.java b/httpclient/src/main/java/org/apache/http/impl/conn/AbstractClientConnAdapter.java index 4d5718b4c..7be7bc9d4 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/AbstractClientConnAdapter.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/AbstractClientConnAdapter.java @@ -128,7 +128,8 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti /** * @deprecated (4.1) use {@link #assertValid(OperatedClientConnection)} */ - protected final void assertNotAborted() throws InterruptedIOException { + @Deprecated + protected final void assertNotAborted() throws InterruptedIOException { if (isReleased()) { throw new InterruptedIOException("Connection has been shut down"); } diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java b/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java index db98e8431..444cb9f07 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java @@ -74,7 +74,8 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte * * @deprecated (4.0.1) */ - protected AbstractPoolEntry getPoolEntry() { + @Deprecated + protected AbstractPoolEntry getPoolEntry() { return this.poolEntry; } @@ -95,7 +96,8 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte /** * @deprecated (4.1) use {@link #assertValid(AbstractPoolEntry)} */ - protected final void assertAttached() { + @Deprecated + protected final void assertAttached() { if (poolEntry == null) { throw new ConnectionShutdownException(); } diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java b/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java index 894fa13ad..b644f26be 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java @@ -61,6 +61,7 @@ import org.apache.http.util.CharArrayBuffer; * * @deprecated (4.2) use {@link DefaultHttpResponseParser} */ +@Deprecated @ThreadSafe // no public methods public class DefaultResponseParser extends AbstractMessageParser { diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java b/httpclient/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java index 114064068..9f68ae304 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java @@ -107,7 +107,8 @@ public class SingleClientConnManager implements ClientConnectionManager { * * @deprecated (4.1) use {@link SingleClientConnManager#SingleClientConnManager(SchemeRegistry)} */ - public SingleClientConnManager(HttpParams params, + @Deprecated + public SingleClientConnManager(HttpParams params, SchemeRegistry schreg) { this(schreg); } diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java index d898bf82e..65cf3c6b6 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java @@ -149,7 +149,8 @@ public class ConnPoolByRoute extends AbstractConnPool { * * @deprecated (4.1) use {@link ConnPoolByRoute#ConnPoolByRoute(ClientConnectionOperator, ConnPerRoute, int)} */ - public ConnPoolByRoute(final ClientConnectionOperator operator, final HttpParams params) { + @Deprecated + public ConnPoolByRoute(final ClientConnectionOperator operator, final HttpParams params) { this(operator, ConnManagerParams.getMaxConnectionsPerRoute(params), ConnManagerParams.getMaxTotalConnections(params)); diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java index 3283ad126..b943c0cb9 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java @@ -77,7 +77,8 @@ public class RouteSpecificPool { /** * @deprecated (4.1) use {@link RouteSpecificPool#RouteSpecificPool(HttpRoute, ConnPerRoute)} */ - public RouteSpecificPool(HttpRoute route, int maxEntries) { + @Deprecated + public RouteSpecificPool(HttpRoute route, int maxEntries) { this.route = route; this.maxEntries = maxEntries; this.connPerRoute = new ConnPerRoute() { diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java index 022794aa7..f4d56b646 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java @@ -149,7 +149,8 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager { * * @deprecated (4.1) use {@link ThreadSafeClientConnManager#ThreadSafeClientConnManager(SchemeRegistry)} */ - public ThreadSafeClientConnManager(HttpParams params, + @Deprecated + public ThreadSafeClientConnManager(HttpParams params, SchemeRegistry schreg) { if (schreg == null) { throw new IllegalArgumentException("Scheme registry may not be null"); @@ -178,7 +179,8 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager { * * @deprecated (4.1) use #createConnectionPool(long, TimeUnit)) */ - protected AbstractConnPool createConnectionPool(final HttpParams params) { + @Deprecated + protected AbstractConnPool createConnectionPool(final HttpParams params) { return new ConnPoolByRoute(connOperator, params); }