From 1db3da376e11db56b75b07e7dd32e40ce8079584 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Fri, 28 Dec 2012 14:48:57 +0000 Subject: [PATCH] tabs -> spaces; removed trailing whilespaces; updated stylecheck definitions git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1426529 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/client/fluent/FluentAsync.java | 12 +- .../http/client/fluent/FluentQuickStart.java | 6 +- .../org/apache/http/client/fluent/Async.java | 24 +- .../apache/http/client/fluent/Content.java | 6 +- .../apache/http/client/fluent/Executor.java | 4 +- .../apache/http/client/fluent/Request.java | 2 +- hc-checkstyle.xml | 4 +- .../http/impl/client/cache/CacheEntity.java | 2 +- .../impl/client/cache/CacheInvalidator.java | 2 +- .../CachedResponseSuitabilityChecker.java | 2 +- .../http/impl/client/cache/CachingExec.java | 4 +- .../impl/client/cache/CachingHttpClient.java | 10 +- .../http/impl/client/cache/Proxies.java | 2 +- .../client/cache/ResponseCachingPolicy.java | 48 ++-- .../cache/memcached/MemcachedCacheEntry.java | 2 +- .../memcached/MemcachedCacheEntryFactory.java | 6 +- .../memcached/SHA256KeyHashingScheme.java | 2 +- .../impl/client/cache/TestCachingExec.java | 226 +++++++++--------- .../cache/TestHttpCacheJiraNumber1147.java | 16 +- .../cache/TestResponseCachingPolicy.java | 10 +- .../TestMemcachedCacheEntryImpl.java | 14 +- .../memcached/TestPrefixKeyHashingScheme.java | 2 +- .../memcached/TestSHA256HashingScheme.java | 2 +- .../examples/client/ClientExecuteProxy.java | 2 +- .../examples/client/ClientExecuteSOCKS.java | 2 +- .../java/org/apache/http/auth/AuthState.java | 4 +- .../client/methods/AbortableHttpRequest.java | 2 +- .../client/methods/CloseableHttpResponse.java | 2 +- .../http/client/params/ClientParamBean.java | 2 +- .../protocol/RequestAcceptEncoding.java | 2 +- .../client/protocol/ResponseAuthCache.java | 2 +- .../protocol/ResponseContentEncoding.java | 4 +- .../apache/http/client/utils/URIBuilder.java | 32 +-- .../http/client/utils/URLEncodedUtils.java | 38 +-- .../http/conn/BasicEofSensorWatcher.java | 2 +- .../apache/http/conn/BasicManagedEntity.java | 4 +- .../conn/params/ConnConnectionPNames.java | 4 +- .../conn/params/ConnConnectionParamBean.java | 6 +- .../http/conn/params/ConnManagerPNames.java | 4 +- .../conn/params/ConnManagerParamBean.java | 4 +- .../http/conn/params/ConnManagerParams.java | 8 +- .../http/conn/params/ConnPerRouteBean.java | 2 +- .../http/conn/scheme/HostNameResolver.java | 2 +- .../scheme/LayeredSchemeSocketFactory.java | 2 +- .../conn/scheme/LayeredSocketFactory.java | 2 +- .../org/apache/http/conn/scheme/Scheme.java | 2 +- .../SchemeLayeredSocketFactoryAdaptor2.java | 6 +- .../conn/ssl/SSLInitializationException.java | 4 +- .../http/cookie/params/CookieSpecPNames.java | 2 +- .../cookie/params/CookieSpecParamBean.java | 2 +- .../apache/http/impl/auth/GGSSchemeBase.java | 2 +- .../apache/http/impl/auth/NTLMEngineImpl.java | 2 +- .../http/impl/auth/NegotiateScheme.java | 2 +- .../impl/auth/NegotiateSchemeFactory.java | 2 +- .../client/AbstractAuthenticationHandler.java | 2 +- .../http/impl/client/AbstractHttpClient.java | 24 +- .../http/impl/client/AutoRetryHttpClient.java | 2 +- .../http/impl/client/ClientParamsStack.java | 2 +- .../client/ContentEncodingHttpClient.java | 4 +- .../impl/client/DecompressingHttpClient.java | 24 +- .../http/impl/client/DefaultHttpClient.java | 2 +- .../DefaultHttpRequestRetryHandler.java | 4 +- .../DefaultProxyAuthenticationHandler.java | 2 +- .../DefaultRedirectStrategyAdaptor.java | 2 +- .../impl/client/DefaultRequestDirector.java | 4 +- .../client/EntityEnclosingRequestWrapper.java | 4 +- .../http/impl/client/HttpClientBuilder.java | 2 +- .../http/impl/client/InternalHttpClient.java | 2 +- .../http/impl/client/MinimalHttpClient.java | 4 +- .../http/impl/client/RequestWrapper.java | 4 +- .../http/impl/client/RoutedRequest.java | 2 +- .../impl/client/SystemDefaultHttpClient.java | 2 +- .../http/impl/client/execchain/Proxies.java | 2 +- .../execchain/RequestEntityExecHandler.java | 2 +- .../ServiceUnavailableRetryExec.java | 4 +- .../impl/conn/AbstractClientConnAdapter.java | 2 +- .../impl/conn/AbstractPooledConnAdapter.java | 8 +- .../conn/BasicClientConnectionManager.java | 4 +- .../conn/DefaultClientConnectionFactory.java | 2 +- .../conn/DefaultClientConnectionOperator.java | 2 +- .../impl/conn/DefaultHttpResponseParser.java | 12 +- .../http/impl/conn/DefaultResponseParser.java | 2 +- .../PoolingHttpClientConnectionManager.java | 2 +- .../impl/conn/SingleClientConnManager.java | 4 +- .../java/org/apache/http/impl/conn/Wire.java | 4 +- .../impl/conn/tsccm/BasicPoolEntryRef.java | 2 +- .../conn/tsccm/BasicPooledConnAdapter.java | 2 +- .../http/impl/conn/tsccm/ConnPoolByRoute.java | 4 +- .../impl/conn/tsccm/PoolEntryRequest.java | 2 +- .../impl/conn/tsccm/RouteSpecificPool.java | 2 +- .../tsccm/ThreadSafeClientConnManager.java | 6 +- .../http/impl/conn/tsccm/WaitingThread.java | 2 +- .../impl/conn/tsccm/WaitingThreadAborter.java | 2 +- .../BrowserCompatVersionAttributeHandler.java | 42 ++-- .../protocol/TestResponseAuthCache.java | 2 +- .../http/client/utils/TestURIBuilder.java | 8 +- .../http/impl/auth/TestNTLMEngineImpl.java | 4 +- .../http/impl/client/DummyHttpClient.java | 10 +- .../client/TestDecompressingHttpClient.java | 84 +++---- .../client/integration/TestSPNegoScheme.java | 10 +- .../TestStatefulConnManagement.java | 4 +- .../impl/conn/SessionInputBufferMock.java | 6 +- .../http/localserver/LocalServerTestBase.java | 2 +- httpmime/pom.xml | 3 +- .../entity/mime/ClientMultipartFormPost.java | 2 +- .../entity/mime/TestMultipartContentBody.java | 2 +- 106 files changed, 454 insertions(+), 453 deletions(-) diff --git a/fluent-hc/src/examples/org/apache/http/client/fluent/FluentAsync.java b/fluent-hc/src/examples/org/apache/http/client/fluent/FluentAsync.java index 00bfd7bbd..36b33b094 100644 --- a/fluent-hc/src/examples/org/apache/http/client/fluent/FluentAsync.java +++ b/fluent-hc/src/examples/org/apache/http/client/fluent/FluentAsync.java @@ -45,7 +45,7 @@ public class FluentAsync { // Use pool of two threads ExecutorService threadpool = Executors.newFixedThreadPool(2); Async async = Async.newInstance().use(threadpool); - + Request[] requests = new Request[] { Request.Get("http://www.google.com/"), Request.Get("http://www.yahoo.com/"), @@ -53,23 +53,23 @@ public class FluentAsync { Request.Get("http://www.apple.com/") }; - + Queue> queue = new LinkedList>(); // Execute requests asynchronously for (final Request request: requests) { Future future = async.execute(request, new FutureCallback() { - + public void failed(final Exception ex) { System.out.println(ex.getMessage() + ": " + request); } - + public void completed(final Content content) { System.out.println("Request completed: " + request); } - + public void cancelled() { } - + }); queue.add(future); } diff --git a/fluent-hc/src/examples/org/apache/http/client/fluent/FluentQuickStart.java b/fluent-hc/src/examples/org/apache/http/client/fluent/FluentQuickStart.java index 9aa8cedb2..9e273a7ad 100644 --- a/fluent-hc/src/examples/org/apache/http/client/fluent/FluentQuickStart.java +++ b/fluent-hc/src/examples/org/apache/http/client/fluent/FluentQuickStart.java @@ -29,10 +29,10 @@ package org.apache.http.client.fluent; public class FluentQuickStart { public static void main(String[] args) throws Exception { - // The fluent API relieves the user from having to deal with manual - // deallocation of system resources at the cost of having to buffer + // The fluent API relieves the user from having to deal with manual + // deallocation of system resources at the cost of having to buffer // response content in memory in some cases. - + Request.Get("http://targethost/homepage") .execute().returnContent(); Request.Post("http://targethost/login") diff --git a/fluent-hc/src/main/java/org/apache/http/client/fluent/Async.java b/fluent-hc/src/main/java/org/apache/http/client/fluent/Async.java index 34b7b35dc..2dfa70595 100644 --- a/fluent-hc/src/main/java/org/apache/http/client/fluent/Async.java +++ b/fluent-hc/src/main/java/org/apache/http/client/fluent/Async.java @@ -49,23 +49,23 @@ public class Async { this.executor = executor; return this; } - + public Async use(final java.util.concurrent.Executor concurrentExec) { this.concurrentExec = concurrentExec; return this; } - + static class ExecRunnable implements Runnable { - + private final BasicFuture future; private final Request request; private final Executor executor; private final ResponseHandler handler; - + ExecRunnable( - final BasicFuture future, - final Request request, - final Executor executor, + final BasicFuture future, + final Request request, + final Executor executor, final ResponseHandler handler) { super(); this.future = future; @@ -83,9 +83,9 @@ public class Async { this.future.failed(ex); } } - + } - + public Future execute( final Request request, final ResponseHandler handler, final FutureCallback callback) { BasicFuture future = new BasicFuture(callback); @@ -103,7 +103,7 @@ public class Async { } return future; } - + public Future execute(final Request request, final ResponseHandler handler) { return execute(request, handler, null); } @@ -111,9 +111,9 @@ public class Async { public Future execute(final Request request, final FutureCallback callback) { return execute(request, new ContentResponseHandler(), callback); } - + public Future execute(final Request request) { return execute(request, new ContentResponseHandler(), null); } - + } diff --git a/fluent-hc/src/main/java/org/apache/http/client/fluent/Content.java b/fluent-hc/src/main/java/org/apache/http/client/fluent/Content.java index 9aefb0342..27beb68d3 100644 --- a/fluent-hc/src/main/java/org/apache/http/client/fluent/Content.java +++ b/fluent-hc/src/main/java/org/apache/http/client/fluent/Content.java @@ -36,8 +36,8 @@ import org.apache.http.protocol.HTTP; public class Content { - public static final Content NO_CONTENT = new Content(new byte[] {}, ContentType.DEFAULT_BINARY); - + public static final Content NO_CONTENT = new Content(new byte[] {}, ContentType.DEFAULT_BINARY); + private final byte[] raw; private final ContentType type; @@ -75,5 +75,5 @@ public class Content { public String toString() { return asString(); } - + } diff --git a/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java b/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java index 2a7ad539f..5157e6c03 100644 --- a/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java +++ b/fluent-hc/src/main/java/org/apache/http/client/fluent/Executor.java @@ -198,10 +198,10 @@ public class Executor { } /** - * Executes the request. Please Note that response content must be processed + * Executes the request. Please Note that response content must be processed * or discarded using {@link Response#discardContent()}, otherwise the * connection used for the request might not be released to the pool. - * + * * @see Response#handleResponse(org.apache.http.client.ResponseHandler) * @see Response#discardContent() */ diff --git a/fluent-hc/src/main/java/org/apache/http/client/fluent/Request.java b/fluent-hc/src/main/java/org/apache/http/client/fluent/Request.java index 3a1890a41..b707a338c 100644 --- a/fluent-hc/src/main/java/org/apache/http/client/fluent/Request.java +++ b/fluent-hc/src/main/java/org/apache/http/client/fluent/Request.java @@ -317,5 +317,5 @@ public class Request { public String toString() { return this.request.getRequestLine().toString(); } - + } diff --git a/hc-checkstyle.xml b/hc-checkstyle.xml index 272fae26d..9a5017873 100644 --- a/hc-checkstyle.xml +++ b/hc-checkstyle.xml @@ -33,11 +33,11 @@ - + diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntity.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntity.java index ee8f830f2..f0d4e4ba1 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntity.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheEntity.java @@ -67,7 +67,7 @@ class CacheEntity implements HttpEntity, Serializable { } public long getContentLength() { - return this.cacheEntry.getResource().length(); + return this.cacheEntry.getResource().length(); } public InputStream getContent() throws IOException { diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheInvalidator.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheInvalidator.java index d20fe17c0..aa32a8fad 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheInvalidator.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CacheInvalidator.java @@ -201,7 +201,7 @@ class CacheInvalidator { // do not invalidate if response is strictly older than entry // or if the etags match - + if (responseDateOlderThanEntryDate(response, entry)) return; if (!responseAndEntryEtagsDiffer(response, entry)) return; diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java index 4ae114756..d3e92710c 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachedResponseSuitabilityChecker.java @@ -148,7 +148,7 @@ class CachedResponseSuitabilityChecker { } if (!isConditional(request) && entry.getStatusCode() == HttpStatus.SC_NOT_MODIFIED) { - return false; + return false; } if (isConditional(request) && !allConditionalsMatch(request, entry, now)) { diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java index f2997323b..bdbf385d0 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java @@ -281,8 +281,8 @@ public class CachingExec implements ClientExecChain { } else if (!mayCallBackend(request)) { log.debug("Cache entry not suitable but only-if-cached requested"); out = Proxies.enhanceResponse(generateGatewayTimeout(context)); - } else if (validityPolicy.isRevalidatable(entry) - && !(entry.getStatusCode() == HttpStatus.SC_NOT_MODIFIED + } else if (validityPolicy.isRevalidatable(entry) + && !(entry.getStatusCode() == HttpStatus.SC_NOT_MODIFIED && !suitabilityChecker.isConditional(request))) { log.debug("Revalidating cache entry"); return revalidateCacheEntry(route, request, context, execAware, entry, now); diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java index dff088a44..b8b9ebe36 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingHttpClient.java @@ -470,13 +470,13 @@ public class CachingHttpClient implements HttpClient { return revalidateCacheEntry(target, request, context, entry, now); } else { log.debug("Cache entry not usable; calling backend"); - return callBackend(target, request, context); + return callBackend(target, request, context); } if (context != null) { - context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, target); - context.setAttribute(ExecutionContext.HTTP_REQUEST, request); - context.setAttribute(ExecutionContext.HTTP_RESPONSE, out); - context.setAttribute(ExecutionContext.HTTP_REQ_SENT, Boolean.TRUE); + context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, target); + context.setAttribute(ExecutionContext.HTTP_REQUEST, request); + context.setAttribute(ExecutionContext.HTTP_RESPONSE, out); + context.setAttribute(ExecutionContext.HTTP_REQ_SENT, Boolean.TRUE); } return out; } diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/Proxies.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/Proxies.java index 06d976d5c..c86a03916 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/Proxies.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/Proxies.java @@ -53,4 +53,4 @@ class Proxies { } } -} \ No newline at end of file +} diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseCachingPolicy.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseCachingPolicy.java index 067eef0f7..80782b3a5 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseCachingPolicy.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ResponseCachingPolicy.java @@ -58,15 +58,15 @@ class ResponseCachingPolicy { private final boolean sharedCache; private final boolean neverCache1_0ResponsesWithQueryString; private final Log log = LogFactory.getLog(getClass()); - private static final Set cacheableStatuses = - new HashSet(Arrays.asList(HttpStatus.SC_OK, - HttpStatus.SC_NON_AUTHORITATIVE_INFORMATION, - HttpStatus.SC_MULTIPLE_CHOICES, - HttpStatus.SC_MOVED_PERMANENTLY, - HttpStatus.SC_GONE)); + private static final Set cacheableStatuses = + new HashSet(Arrays.asList(HttpStatus.SC_OK, + HttpStatus.SC_NON_AUTHORITATIVE_INFORMATION, + HttpStatus.SC_MULTIPLE_CHOICES, + HttpStatus.SC_MOVED_PERMANENTLY, + HttpStatus.SC_GONE)); private static final Set uncacheableStatuses = - new HashSet(Arrays.asList(HttpStatus.SC_PARTIAL_CONTENT, - HttpStatus.SC_SEE_OTHER)); + new HashSet(Arrays.asList(HttpStatus.SC_PARTIAL_CONTENT, + HttpStatus.SC_SEE_OTHER)); /** * Define a cache policy that limits the size of things that should be stored * in the cache to a maximum of {@link HttpResponse} bytes in size. @@ -99,19 +99,19 @@ class ResponseCachingPolicy { log.debug("Response was not cacheable."); return false; } - + int status = response.getStatusLine().getStatusCode(); if (cacheableStatuses.contains(status)) { - // these response codes MAY be cached - cacheable = true; + // these response codes MAY be cached + cacheable = true; } else if (uncacheableStatuses.contains(status)) { - return false; + return false; } else if (unknownStatusCode(status)) { - // a response with an unknown status code MUST NOT be - // cached - return false; + // a response with an unknown status code MUST NOT be + // cached + return false; } - + Header contentLength = response.getFirstHeader(HTTP.CONTENT_LEN); if (contentLength != null) { int contentLengthValue = Integer.parseInt(contentLength.getValue()); @@ -155,15 +155,15 @@ class ResponseCachingPolicy { } private boolean unknownStatusCode(int status) { - if (status >= 100 && status <= 101) return false; - if (status >= 200 && status <= 206) return false; - if (status >= 300 && status <= 307) return false; - if (status >= 400 && status <= 417) return false; - if (status >= 500 && status <= 505) return false; - return true; - } + if (status >= 100 && status <= 101) return false; + if (status >= 200 && status <= 206) return false; + if (status >= 300 && status <= 307) return false; + if (status >= 400 && status <= 417) return false; + if (status >= 500 && status <= 505) return false; + return true; + } - protected boolean isExplicitlyNonCacheable(HttpResponse response) { + protected boolean isExplicitlyNonCacheable(HttpResponse response) { Header[] cacheControlHeaders = response.getHeaders(HeaderConstants.CACHE_CONTROL); for (Header header : cacheControlHeaders) { for (HeaderElement elem : header.getElements()) { diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedCacheEntry.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedCacheEntry.java index bf2217ab9..05739fd62 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedCacheEntry.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedCacheEntry.java @@ -72,4 +72,4 @@ public interface MemcachedCacheEntry { */ void set(byte[] bytes); -} \ No newline at end of file +} diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedCacheEntryFactory.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedCacheEntryFactory.java index 9cc4d52be..2cf7d1eca 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedCacheEntryFactory.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/MemcachedCacheEntryFactory.java @@ -43,14 +43,14 @@ public interface MemcachedCacheEntryFactory { * cache collisions. Therefore, we store the storage key along * with the HttpCacheEntry so it can be compared * on retrieval and thus detect collisions. - * @param storageKey storage key under which the entry will + * @param storageKey storage key under which the entry will * be logically stored * @param entry the cache entry to store * @return a {@link MemcachedCacheEntry} ready to provide * a serialized representation */ MemcachedCacheEntry getMemcachedCacheEntry(String storageKey, HttpCacheEntry entry); - + /** * Creates an "unset" {@link MemcachedCacheEntry} ready to accept * a serialized representation via {@link MemcachedCacheEntry#set(byte[])} @@ -59,4 +59,4 @@ public interface MemcachedCacheEntryFactory { */ MemcachedCacheEntry getUnsetCacheEntry(); -} \ No newline at end of file +} diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/SHA256KeyHashingScheme.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/SHA256KeyHashingScheme.java index 0de84abed..fc7a38540 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/SHA256KeyHashingScheme.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/SHA256KeyHashingScheme.java @@ -43,7 +43,7 @@ import org.apache.commons.logging.LogFactory; public class SHA256KeyHashingScheme implements KeyHashingScheme { private static final Log log = LogFactory.getLog(SHA256KeyHashingScheme.class); - + public String hash(String key) { MessageDigest md = getDigest(); md.update(key.getBytes()); diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java index 604caec49..d03a6d25c 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java @@ -1574,152 +1574,152 @@ public class TestCachingExec { assertEquals(1, backend.getExecutions()); } - @Test - public void testNoEntityForIfNoneMatchRequestNotYetInCache() throws Exception { + @Test + public void testNoEntityForIfNoneMatchRequestNotYetInCache() throws Exception { - Date now = new Date(); - Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L); + Date now = new Date(); + Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L); - impl = new CachingExec(mockBackend, new BasicHttpCache(), - CacheConfig.DEFAULT); - HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet( - "http://foo.example.com/")); - req1.addHeader("If-None-Match", "\"etag\""); + impl = new CachingExec(mockBackend, new BasicHttpCache(), + CacheConfig.DEFAULT); + HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet( + "http://foo.example.com/")); + req1.addHeader("If-None-Match", "\"etag\""); - HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, - HttpStatus.SC_NOT_MODIFIED, "Not modified"); - resp1.setHeader("Content-Length", "128"); - resp1.setHeader("ETag", "\"etag\""); - resp1.setHeader("Date", DateUtils.formatDate(tenSecondsAgo)); - resp1.setHeader("Cache-Control", "public, max-age=5"); + HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, + HttpStatus.SC_NOT_MODIFIED, "Not modified"); + resp1.setHeader("Content-Length", "128"); + resp1.setHeader("ETag", "\"etag\""); + resp1.setHeader("Date", DateUtils.formatDate(tenSecondsAgo)); + resp1.setHeader("Cache-Control", "public, max-age=5"); - backendExpectsAnyRequestAndReturn(resp1); - replayMocks(); - HttpResponse result = impl.execute(route, req1); - verifyMocks(); + backendExpectsAnyRequestAndReturn(resp1); + replayMocks(); + HttpResponse result = impl.execute(route, req1); + verifyMocks(); - assertEquals(HttpStatus.SC_NOT_MODIFIED, result.getStatusLine() - .getStatusCode()); - assertNull("The 304 response messages MUST NOT contain a message-body", - result.getEntity()); - } + assertEquals(HttpStatus.SC_NOT_MODIFIED, result.getStatusLine() + .getStatusCode()); + assertNull("The 304 response messages MUST NOT contain a message-body", + result.getEntity()); + } - @Test - public void testNotModifiedResponseUpdatesCacheEntryWhenNoEntity() throws Exception { + @Test + public void testNotModifiedResponseUpdatesCacheEntryWhenNoEntity() throws Exception { - Date now = new Date(); + Date now = new Date(); - impl = new CachingExec(mockBackend, new BasicHttpCache(),CacheConfig.DEFAULT); + impl = new CachingExec(mockBackend, new BasicHttpCache(),CacheConfig.DEFAULT); - HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); - req1.addHeader("If-None-Match", "etag"); + HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); + req1.addHeader("If-None-Match", "etag"); - HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); - req2.addHeader("If-None-Match", "etag"); + HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); + req2.addHeader("If-None-Match", "etag"); - HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); - resp1.setHeader("Date", DateUtils.formatDate(now)); - resp1.setHeader("Cache-Control","max-age=0"); - resp1.setHeader("Etag", "etag"); + HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); + resp1.setHeader("Date", DateUtils.formatDate(now)); + resp1.setHeader("Cache-Control","max-age=0"); + resp1.setHeader("Etag", "etag"); - HttpResponse resp2 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); - resp2.setHeader("Date", DateUtils.formatDate(now)); - resp2.setHeader("Cache-Control","max-age=0"); - resp1.setHeader("Etag", "etag"); + HttpResponse resp2 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); + resp2.setHeader("Date", DateUtils.formatDate(now)); + resp2.setHeader("Cache-Control","max-age=0"); + resp1.setHeader("Etag", "etag"); - backendExpectsAnyRequestAndReturn(resp1); - backendExpectsAnyRequestAndReturn(resp2); - replayMocks(); - HttpResponse result1 = impl.execute(route, req1); - HttpResponse result2 = impl.execute(route, req2); - verifyMocks(); + backendExpectsAnyRequestAndReturn(resp1); + backendExpectsAnyRequestAndReturn(resp2); + replayMocks(); + HttpResponse result1 = impl.execute(route, req1); + HttpResponse result2 = impl.execute(route, req2); + verifyMocks(); - assertEquals(HttpStatus.SC_NOT_MODIFIED, result1.getStatusLine().getStatusCode()); - assertEquals("etag", result1.getFirstHeader("Etag").getValue()); - assertEquals(HttpStatus.SC_NOT_MODIFIED, result2.getStatusLine().getStatusCode()); - assertEquals("etag", result2.getFirstHeader("Etag").getValue()); - } + assertEquals(HttpStatus.SC_NOT_MODIFIED, result1.getStatusLine().getStatusCode()); + assertEquals("etag", result1.getFirstHeader("Etag").getValue()); + assertEquals(HttpStatus.SC_NOT_MODIFIED, result2.getStatusLine().getStatusCode()); + assertEquals("etag", result2.getFirstHeader("Etag").getValue()); + } - @Test - public void testNotModifiedResponseWithVaryUpdatesCacheEntryWhenNoEntity() throws Exception { + @Test + public void testNotModifiedResponseWithVaryUpdatesCacheEntryWhenNoEntity() throws Exception { - Date now = new Date(); + Date now = new Date(); - impl = new CachingExec(mockBackend, new BasicHttpCache(),CacheConfig.DEFAULT); + impl = new CachingExec(mockBackend, new BasicHttpCache(),CacheConfig.DEFAULT); - HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); - req1.addHeader("If-None-Match", "etag"); + HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); + req1.addHeader("If-None-Match", "etag"); - HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); - req2.addHeader("If-None-Match", "etag"); + HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); + req2.addHeader("If-None-Match", "etag"); - HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); - resp1.setHeader("Date", DateUtils.formatDate(now)); - resp1.setHeader("Cache-Control","max-age=0"); - resp1.setHeader("Etag", "etag"); - resp1.setHeader("Vary", "Accept-Encoding"); + HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); + resp1.setHeader("Date", DateUtils.formatDate(now)); + resp1.setHeader("Cache-Control","max-age=0"); + resp1.setHeader("Etag", "etag"); + resp1.setHeader("Vary", "Accept-Encoding"); - HttpResponse resp2 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); - resp2.setHeader("Date", DateUtils.formatDate(now)); - resp2.setHeader("Cache-Control","max-age=0"); - resp1.setHeader("Etag", "etag"); - resp1.setHeader("Vary", "Accept-Encoding"); + HttpResponse resp2 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); + resp2.setHeader("Date", DateUtils.formatDate(now)); + resp2.setHeader("Cache-Control","max-age=0"); + resp1.setHeader("Etag", "etag"); + resp1.setHeader("Vary", "Accept-Encoding"); - backendExpectsAnyRequestAndReturn(resp1); - backendExpectsAnyRequestAndReturn(resp2); - replayMocks(); - HttpResponse result1 = impl.execute(route, req1); - HttpResponse result2 = impl.execute(route, req2); - verifyMocks(); + backendExpectsAnyRequestAndReturn(resp1); + backendExpectsAnyRequestAndReturn(resp2); + replayMocks(); + HttpResponse result1 = impl.execute(route, req1); + HttpResponse result2 = impl.execute(route, req2); + verifyMocks(); - assertEquals(HttpStatus.SC_NOT_MODIFIED, result1.getStatusLine().getStatusCode()); - assertEquals("etag", result1.getFirstHeader("Etag").getValue()); - assertEquals(HttpStatus.SC_NOT_MODIFIED, result2.getStatusLine().getStatusCode()); - assertEquals("etag", result2.getFirstHeader("Etag").getValue()); - } + assertEquals(HttpStatus.SC_NOT_MODIFIED, result1.getStatusLine().getStatusCode()); + assertEquals("etag", result1.getFirstHeader("Etag").getValue()); + assertEquals(HttpStatus.SC_NOT_MODIFIED, result2.getStatusLine().getStatusCode()); + assertEquals("etag", result2.getFirstHeader("Etag").getValue()); + } - @Test - public void testDoesNotSend304ForNonConditionalRequest() throws Exception { + @Test + public void testDoesNotSend304ForNonConditionalRequest() throws Exception { - Date now = new Date(); - Date inOneMinute = new Date(System.currentTimeMillis()+60000); + Date now = new Date(); + Date inOneMinute = new Date(System.currentTimeMillis()+60000); - impl = new CachingExec(mockBackend, new BasicHttpCache(),CacheConfig.DEFAULT); + impl = new CachingExec(mockBackend, new BasicHttpCache(),CacheConfig.DEFAULT); - HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); - req1.addHeader("If-None-Match", "etag"); + HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); + req1.addHeader("If-None-Match", "etag"); - HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); + HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/")); - HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); - resp1.setHeader("Date", DateUtils.formatDate(now)); - resp1.setHeader("Cache-Control","public, max-age=60"); - resp1.setHeader("Expires",DateUtils.formatDate(inOneMinute)); - resp1.setHeader("Etag", "etag"); - resp1.setHeader("Vary", "Accept-Encoding"); + HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not modified"); + resp1.setHeader("Date", DateUtils.formatDate(now)); + resp1.setHeader("Cache-Control","public, max-age=60"); + resp1.setHeader("Expires",DateUtils.formatDate(inOneMinute)); + resp1.setHeader("Etag", "etag"); + resp1.setHeader("Vary", "Accept-Encoding"); - HttpResponse resp2 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "Ok"); - resp2.setHeader("Date", DateUtils.formatDate(now)); - resp2.setHeader("Cache-Control","public, max-age=60"); - resp2.setHeader("Expires",DateUtils.formatDate(inOneMinute)); - resp2.setHeader("Etag", "etag"); - resp2.setHeader("Vary", "Accept-Encoding"); - resp2.setEntity(HttpTestUtils.makeBody(128)); + HttpResponse resp2 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "Ok"); + resp2.setHeader("Date", DateUtils.formatDate(now)); + resp2.setHeader("Cache-Control","public, max-age=60"); + resp2.setHeader("Expires",DateUtils.formatDate(inOneMinute)); + resp2.setHeader("Etag", "etag"); + resp2.setHeader("Vary", "Accept-Encoding"); + resp2.setEntity(HttpTestUtils.makeBody(128)); - backendExpectsAnyRequestAndReturn(resp1); - backendExpectsAnyRequestAndReturn(resp2).anyTimes(); - replayMocks(); - HttpResponse result1 = impl.execute(route, req1); - HttpResponse result2 = impl.execute(route, req2); - verifyMocks(); + backendExpectsAnyRequestAndReturn(resp1); + backendExpectsAnyRequestAndReturn(resp2).anyTimes(); + replayMocks(); + HttpResponse result1 = impl.execute(route, req1); + HttpResponse result2 = impl.execute(route, req2); + verifyMocks(); - assertEquals(HttpStatus.SC_NOT_MODIFIED, result1.getStatusLine().getStatusCode()); - assertNull(result1.getEntity()); - assertEquals(HttpStatus.SC_OK, result2.getStatusLine().getStatusCode()); - Assert.assertNotNull(result2.getEntity()); - } + assertEquals(HttpStatus.SC_NOT_MODIFIED, result1.getStatusLine().getStatusCode()); + assertNull(result1.getEntity()); + assertEquals(HttpStatus.SC_OK, result2.getStatusLine().getStatusCode()); + Assert.assertNotNull(result2.getEntity()); + } - private IExpectationSetters backendExpectsAnyRequestAndReturn( + private IExpectationSetters backendExpectsAnyRequestAndReturn( HttpResponse response) throws Exception { CloseableHttpResponse resp = mockBackend.execute( EasyMock.isA(HttpRoute.class), diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java index 1a03e83bf..547613a17 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java @@ -73,12 +73,12 @@ public class TestHttpCacheJiraNumber1147 { } cacheDir.mkdir(); } - + @After public void cleanUp() { removeCache(); } - + @Test public void testIssue1147() throws Exception { CacheConfig cacheConfig = CacheConfig.custom() @@ -97,30 +97,30 @@ public class TestHttpCacheJiraNumber1147 { Date now = new Date(); Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L); - + HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"); response.setEntity(HttpTestUtils.makeBody(128)); response.setHeader("Content-Length", "128"); response.setHeader("ETag", "\"etag\""); response.setHeader("Cache-Control", "public, max-age=3600"); response.setHeader("Last-Modified", DateUtils.formatDate(tenSecondsAgo)); - + EasyMock.expect(backend.execute( EasyMock.eq(route), EasyMock.isA(HttpRequestWrapper.class), EasyMock.same(context), EasyMock.isNull())).andReturn(Proxies.enhanceResponse(response)); EasyMock.replay(backend); - + BasicHttpCache cache = new BasicHttpCache(resourceFactory, httpCacheStorage, cacheConfig); CachingExec t = new CachingExec(backend, cache, cacheConfig); HttpResponse response1 = t.execute(route, get, context, null); Assert.assertEquals(200, response1.getStatusLine().getStatusCode()); EntityUtils.consume(response1.getEntity()); - + EasyMock.verify(backend); - + removeCache(); EasyMock.reset(backend); @@ -130,7 +130,7 @@ public class TestHttpCacheJiraNumber1147 { EasyMock.same(context), EasyMock.isNull())).andReturn(Proxies.enhanceResponse(response)); EasyMock.replay(backend); - + HttpResponse response2 = t.execute(route, get, context, null); Assert.assertEquals(200, response2.getStatusLine().getStatusCode()); EntityUtils.consume(response2.getEntity()); diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java index fa201b343..69b7ebccd 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java @@ -516,13 +516,13 @@ public class TestResponseCachingPolicy { response.removeHeaders("Cache-Control"); Assert.assertFalse(policy.isResponseCacheable(request, response)); } - + @Test public void otherStatusCodesAreCacheableWithExplicitCachingHeaders() { - response.setStatusCode(HttpStatus.SC_NOT_FOUND); - response.setHeader("Date", formatDate(now)); - response.setHeader("Cache-Control","max-age=300"); - Assert.assertTrue(policy.isResponseCacheable(request, response)); + response.setStatusCode(HttpStatus.SC_NOT_FOUND); + response.setHeader("Date", formatDate(now)); + response.setHeader("Cache-Control","max-age=300"); + Assert.assertTrue(policy.isResponseCacheable(request, response)); } private int getRandomStatus() { diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedCacheEntryImpl.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedCacheEntryImpl.java index 528b3c582..b5d710839 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedCacheEntryImpl.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedCacheEntryImpl.java @@ -51,31 +51,31 @@ public class TestMemcachedCacheEntryImpl { entry = HttpTestUtils.makeCacheEntry(); impl = new MemcachedCacheEntryImpl("foo", entry); } - + @Test public void canBeCreatedEmpty() { impl = new MemcachedCacheEntryImpl(); assertNull(impl.getStorageKey()); assertNull(impl.getHttpCacheEntry()); } - + @Test public void canBeSerialized() { byte[] bytes = impl.toByteArray(); assertNotNull(bytes); assertTrue(bytes.length > 0); } - + @Test public void knowsItsCacheKey() { assertEquals("foo", impl.getStorageKey()); } - + @Test public void knowsItsCacheEntry() { assertEquals(entry, impl.getHttpCacheEntry()); } - + @Test public void canBeReconstitutedFromByteArray() throws Exception { String key = impl.getStorageKey(); @@ -83,11 +83,11 @@ public class TestMemcachedCacheEntryImpl { byte[] bytes = impl.toByteArray(); impl = new MemcachedCacheEntryImpl(); impl.set(bytes); - + assertEquals(key, impl.getStorageKey()); assertEquivalent(entry, impl.getHttpCacheEntry()); } - + @Test(expected=MemcachedSerializationException.class) public void cannotReconstituteFromGarbage() { impl = new MemcachedCacheEntryImpl(); diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestPrefixKeyHashingScheme.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestPrefixKeyHashingScheme.java index 2dc01138a..65cb77438 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestPrefixKeyHashingScheme.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestPrefixKeyHashingScheme.java @@ -49,7 +49,7 @@ public class TestPrefixKeyHashingScheme { }; impl = new PrefixKeyHashingScheme(PREFIX, scheme); } - + @Test public void addsPrefixToBackingScheme() { assertEquals("prefixhash", impl.hash(KEY)); diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestSHA256HashingScheme.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestSHA256HashingScheme.java index eb5af914c..2bdaf89f5 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestSHA256HashingScheme.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestSHA256HashingScheme.java @@ -39,5 +39,5 @@ public class TestSHA256HashingScheme { String result = impl.hash("hello, hashing world"); assertTrue(result != null && result.length() > 0); } - + } diff --git a/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteProxy.java b/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteProxy.java index b1c630124..108c08818 100644 --- a/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteProxy.java +++ b/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteProxy.java @@ -79,4 +79,4 @@ public class ClientExecuteProxy { } } -} \ No newline at end of file +} diff --git a/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java b/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java index f93852e0b..4a3c8b258 100644 --- a/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java +++ b/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java @@ -130,4 +130,4 @@ public class ClientExecuteSOCKS { } -} \ No newline at end of file +} diff --git a/httpclient/src/main/java/org/apache/http/auth/AuthState.java b/httpclient/src/main/java/org/apache/http/auth/AuthState.java index 3a653d513..f562a1061 100644 --- a/httpclient/src/main/java/org/apache/http/auth/AuthState.java +++ b/httpclient/src/main/java/org/apache/http/auth/AuthState.java @@ -154,7 +154,7 @@ public class AuthState { * * @deprecated (4.2) use {@link #reset()} */ - @Deprecated + @Deprecated public void invalidate() { reset(); } @@ -174,7 +174,7 @@ public class AuthState { * * @deprecated (4.2) use {@link #update(AuthScheme, Credentials)} */ - @Deprecated + @Deprecated public void setAuthScheme(final AuthScheme authScheme) { if (authScheme == null) { reset(); diff --git a/httpclient/src/main/java/org/apache/http/client/methods/AbortableHttpRequest.java b/httpclient/src/main/java/org/apache/http/client/methods/AbortableHttpRequest.java index a757aa1fb..ca7cc7c7d 100644 --- a/httpclient/src/main/java/org/apache/http/client/methods/AbortableHttpRequest.java +++ b/httpclient/src/main/java/org/apache/http/client/methods/AbortableHttpRequest.java @@ -40,7 +40,7 @@ import org.apache.http.conn.ManagedClientConnection; * down the underlying HTTP connection. * * @since 4.0 - * + * * @deprecated (4.3) use {@link HttpExecutionAware} */ @Deprecated diff --git a/httpclient/src/main/java/org/apache/http/client/methods/CloseableHttpResponse.java b/httpclient/src/main/java/org/apache/http/client/methods/CloseableHttpResponse.java index a7cfbcefa..d0391daa3 100644 --- a/httpclient/src/main/java/org/apache/http/client/methods/CloseableHttpResponse.java +++ b/httpclient/src/main/java/org/apache/http/client/methods/CloseableHttpResponse.java @@ -33,7 +33,7 @@ import org.apache.http.HttpResponse; /** * Extended version of the {@link HttpResponse} interface that also extends {@link Closeable}. - * + * * @since 4.3 */ public interface CloseableHttpResponse extends HttpResponse, Closeable { diff --git a/httpclient/src/main/java/org/apache/http/client/params/ClientParamBean.java b/httpclient/src/main/java/org/apache/http/client/params/ClientParamBean.java index 074544826..8f36a8dab 100644 --- a/httpclient/src/main/java/org/apache/http/client/params/ClientParamBean.java +++ b/httpclient/src/main/java/org/apache/http/client/params/ClientParamBean.java @@ -56,7 +56,7 @@ public class ClientParamBean extends HttpAbstractParamBean { /** * @deprecated (4.2) do not use. */ - @Deprecated + @Deprecated public void setConnectionManagerFactoryClassName (final String factory) { params.setParameter(ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME, factory); } diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAcceptEncoding.java b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAcceptEncoding.java index c7a714826..610c7459e 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAcceptEncoding.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAcceptEncoding.java @@ -56,7 +56,7 @@ public class RequestAcceptEncoding implements HttpRequestInterceptor { /* Signal support for Accept-Encoding transfer encodings. */ if (!request.containsHeader("Accept-Encoding")) { request.addHeader("Accept-Encoding", "gzip,deflate"); - } + } } } diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java b/httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java index cfc4a7116..4583f70a2 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/ResponseAuthCache.java @@ -59,7 +59,7 @@ import org.apache.http.util.Args; * @deprecated (4.2) use {@link AuthenticationStrategy} */ @Immutable -@Deprecated +@Deprecated public class ResponseAuthCache implements HttpResponseInterceptor { private final Log log = LogFactory.getLog(getClass()); diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java b/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java index a18266d1a..2de3a5a63 100644 --- a/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java +++ b/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java @@ -52,8 +52,8 @@ import org.apache.http.protocol.HttpContext; @Immutable public class ResponseContentEncoding implements HttpResponseInterceptor { - public static final String UNCOMPRESSED = "http.client.response.uncompressed"; - + public static final String UNCOMPRESSED = "http.client.response.uncompressed"; + /** * Handles the following {@code Content-Encoding}s by * using the appropriate decompressor to wrap the response Entity: diff --git a/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java b/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java index 0df2eb98f..177e07bc7 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java +++ b/httpclient/src/main/java/org/apache/http/client/utils/URIBuilder.java @@ -72,7 +72,7 @@ public class URIBuilder { /** * Construct an instance from the string which must be a valid URI. - * + * * @param string a valid URI in string form * @throws URISyntaxException if the input is not a valid URI */ @@ -103,7 +103,7 @@ public class URIBuilder { public URI build() throws URISyntaxException { return new URI(buildString()); } - + private String buildString() { StringBuilder sb = new StringBuilder(); if (this.scheme != null) { @@ -256,9 +256,9 @@ public class URIBuilder { * Sets URI query. *

* The value is expected to be encoded form data. - * + * * @deprecated (4.3) use {@link #setParameters(List)} or {@link #setParameters(NameValuePair...)} - * + * * @see URLEncodedUtils#parse */ @Deprecated @@ -269,14 +269,14 @@ public class URIBuilder { this.encodedSchemeSpecificPart = null; return this; } - + /** * Sets URI query parameters. The parameter name / values are expected to be unescaped * and may contain non ASCII characters. *

* Please note query parameters and custom query component are mutually exclusive. This method * will remove custom query if present. - * + * * @since 4.3 */ public URIBuilder setParameters(final List nvps) { @@ -291,14 +291,14 @@ public class URIBuilder { this.query = null; return this; } - + /** * Adds URI query parameters. The parameter name / values are expected to be unescaped * and may contain non ASCII characters. *

* Please note query parameters and custom query component are mutually exclusive. This method * will remove custom query if present. - * + * * @since 4.3 */ public URIBuilder addParameters(final List nvps) { @@ -311,14 +311,14 @@ public class URIBuilder { this.query = null; return this; } - + /** * Sets URI query parameters. The parameter name / values are expected to be unescaped * and may contain non ASCII characters. *

* Please note query parameters and custom query component are mutually exclusive. This method * will remove custom query if present. - * + * * @since 4.3 */ public URIBuilder setParameters(final NameValuePair... nvps) { @@ -335,7 +335,7 @@ public class URIBuilder { this.query = null; return this; } - + /** * Adds parameter to URI query. The parameter name and value are expected to be unescaped * and may contain non ASCII characters. @@ -382,7 +382,7 @@ public class URIBuilder { /** * Clears URI query parameters. - * + * * @since 4.3 */ public URIBuilder clearParameters() { @@ -391,14 +391,14 @@ public class URIBuilder { this.encodedSchemeSpecificPart = null; return this; } - + /** * Sets custom URI query. The value is expected to be unescaped and may contain non ASCII - * characters. + * characters. *

* Please note query parameters and custom query component are mutually exclusive. This method * will remove query parameters if present. - * + * * @since 4.3 */ public URIBuilder setCustomQuery(final String query) { @@ -408,7 +408,7 @@ public class URIBuilder { this.queryParams = null; return this; } - + /** * Sets URI fragment. The value is expected to be unescaped and may contain non ASCII * characters. diff --git a/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java b/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java index 6c20ee792..e4ce557f8 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java +++ b/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java @@ -257,7 +257,7 @@ public class URLEncodedUtils { return result.toString(); } - /** + /** * Unreserved characters, i.e. alphanumeric, plus: {@code _ - ! . ~ ' ( ) *} *

* This list is the same as the {@code unreserved} list in @@ -270,28 +270,28 @@ public class URLEncodedUtils { * These are the additional characters allowed by userinfo. */ private static final BitSet PUNCT = new BitSet(256); - /** Characters which are safe to use in userinfo, + /** Characters which are safe to use in userinfo, * i.e. {@link #UNRESERVED} plus {@link #PUNCT}uation */ private static final BitSet USERINFO = new BitSet(256); - /** Characters which are safe to use in a path, + /** Characters which are safe to use in a path, * i.e. {@link #UNRESERVED} plus {@link #PUNCT}uation plus / @ */ private static final BitSet PATHSAFE = new BitSet(256); - /** Characters which are safe to use in a query or a fragment, + /** Characters which are safe to use in a query or a fragment, * i.e. {@link #RESERVED} plus {@link #UNRESERVED} */ private static final BitSet URIC = new BitSet(256); - /** + /** * Reserved characters, i.e. {@code ;/?:@&=+$,[]} *

- * This list is the same as the {@code reserved} list in + * This list is the same as the {@code reserved} list in * RFC 2396 * as augmented by * RFC 2732 */ private static final BitSet RESERVED = new BitSet(256); - - /** + + /** * Safe characters for x-www-form-urlencoded data, as per java.net.URLEncoder and browser behaviour, * i.e. alphanumeric plus {@code "-", "_", ".", "*"} */ @@ -343,7 +343,7 @@ public class URLEncodedUtils { PATHSAFE.set('+'); PATHSAFE.set('$'); PATHSAFE.set(','); - + RESERVED.set(';'); RESERVED.set('/'); RESERVED.set('?'); @@ -356,7 +356,7 @@ public class URLEncodedUtils { RESERVED.set(','); RESERVED.set('['); // added by RFC 2732 RESERVED.set(']'); // added by RFC 2732 - + URIC.or(RESERVED); URIC.or(UNRESERVED); } @@ -365,7 +365,7 @@ public class URLEncodedUtils { /** * Emcode/escape a portion of a URL, to use with the query part ensure {@code plusAsBlank} is true. - * + * * @param content the portion to decode * @param charset the charset to use * @param blankAsPlus if {@code true}, then convert space to '+' (e.g. for www-url-form-encoded content), otherwise leave as is. @@ -400,7 +400,7 @@ public class URLEncodedUtils { /** * Decode/unescape a portion of a URL, to use with the query part ensure {@code plusAsBlank} is true. - * + * * @param content the portion to decode * @param charset the charset to use * @param plusAsBlank if {@code true}, then convert '+' to space (e.g. for www-url-form-encoded content), otherwise leave as is. @@ -441,7 +441,7 @@ public class URLEncodedUtils { /** * Decode/unescape www-url-form-encoded content. - * + * * @param content the content to decode, will decode '+' as space * @param charset the charset to use * @return @@ -455,7 +455,7 @@ public class URLEncodedUtils { /** * Decode/unescape www-url-form-encoded content. - * + * * @param content the content to decode, will decode '+' as space * @param charset the charset to use * @return @@ -473,7 +473,7 @@ public class URLEncodedUtils { * Uses the {@link #URLENCODER} set of characters, rather than * the {@link #UNRSERVED} set; this is for compatibilty with previous * releases, URLEncoder.encode() and most browsers. - * + * * @param content the content to encode, will convert space to '+' * @param charset the charset to use * @return @@ -492,7 +492,7 @@ public class URLEncodedUtils { * Uses the {@link #URLENCODER} set of characters, rather than * the {@link #UNRSERVED} set; this is for compatibilty with previous * releases, URLEncoder.encode() and most browsers. - * + * * @param content the content to encode, will convert space to '+' * @param charset the charset to use * @return @@ -508,7 +508,7 @@ public class URLEncodedUtils { * Encode a String using the {@link #USERINFO} set of characters. *

* Used by URIBuilder to encode the userinfo segment. - * + * * @param content the string to encode, does not convert space to '+' * @param charset the charset to use * @return the encoded string @@ -521,7 +521,7 @@ public class URLEncodedUtils { * Encode a String using the {@link #URIC} set of characters. *

* Used by URIBuilder to encode the query and fragment segments. - * + * * @param content the string to encode, does not convert space to '+' * @param charset the charset to use * @return the encoded string @@ -534,7 +534,7 @@ public class URLEncodedUtils { * Encode a String using the {@link #PATHSAFE} set of characters. *

* Used by URIBuilder to encode path segments. - * + * * @param content the string to encode, does not convert space to '+' * @param charset the charset to use * @return the encoded string diff --git a/httpclient/src/main/java/org/apache/http/conn/BasicEofSensorWatcher.java b/httpclient/src/main/java/org/apache/http/conn/BasicEofSensorWatcher.java index 6862e91aa..534f8c362 100644 --- a/httpclient/src/main/java/org/apache/http/conn/BasicEofSensorWatcher.java +++ b/httpclient/src/main/java/org/apache/http/conn/BasicEofSensorWatcher.java @@ -37,7 +37,7 @@ import org.apache.http.util.Args; * is released on close or EOF. * * @since 4.0 - * + * * @deprecated (4.3) do not use. */ @Deprecated 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 ce076d051..8c6abc446 100644 --- a/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java +++ b/httpclient/src/main/java/org/apache/http/conn/BasicManagedEntity.java @@ -44,7 +44,7 @@ import org.apache.http.util.EntityUtils; * the unmanaged entity in the response with a managed one. * * @since 4.0 - * + * * @deprecated (4.3) do not use. */ @Deprecated @@ -106,7 +106,7 @@ public class BasicManagedEntity extends HttpEntityWrapper * @deprecated (4.1) Use {@link EntityUtils#consume(HttpEntity)} */ @Deprecated - @Override + @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 fa3df92ff..31f348c12 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 @@ -32,7 +32,7 @@ import org.apache.http.impl.conn.DefaultHttpResponseParser; * Parameter names for HTTP client connections. * * @since 4.0 - * + * * @deprecated (4.1) use custom {@link DefaultHttpResponseParser} implementation. */ @Deprecated @@ -58,7 +58,7 @@ public interface ConnConnectionPNames { * @deprecated (4.1) Use custom {@link DefaultHttpResponseParser} implementation */ @Deprecated - public static final String MAX_STATUS_LINE_GARBAGE = "http.connection.max-status-line-garbage"; + 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 54cf766d3..813725057 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 @@ -37,10 +37,10 @@ import org.apache.http.params.HttpParams; * using Java Beans conventions. * * @since 4.0 - * + * * @deprecated (4.2) do not use */ -@Deprecated +@Deprecated public class ConnConnectionParamBean extends HttpAbstractParamBean { public ConnConnectionParamBean (final HttpParams params) { @@ -51,7 +51,7 @@ public class ConnConnectionParamBean extends HttpAbstractParamBean { * @deprecated (4.2) Use custom {@link DefaultHttpResponseParser} implementation */ @Deprecated - public void setMaxStatusLineGarbage (final int maxStatusLineGarbage) { + 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/ConnManagerPNames.java b/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java index 2ddf5f421..0113ab692 100644 --- a/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java +++ b/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerPNames.java @@ -30,10 +30,10 @@ package org.apache.http.conn.params; * Parameter names for connection managers in HttpConn. * * @since 4.0 - * + * * @deprecated (4.1) use configuration methods of the specific connection manager implementation. */ -@Deprecated +@Deprecated public interface ConnManagerPNames { /** diff --git a/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerParamBean.java b/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerParamBean.java index b32df6d85..2dd56a057 100644 --- a/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerParamBean.java +++ b/httpclient/src/main/java/org/apache/http/conn/params/ConnManagerParamBean.java @@ -37,11 +37,11 @@ import org.apache.http.params.HttpParams; * using Java Beans conventions. * * @since 4.0 - * + * * @deprecated (4.1) use configuration methods of the specific connection manager implementation. */ @NotThreadSafe -@Deprecated +@Deprecated public class ConnManagerParamBean extends HttpAbstractParamBean { public ConnManagerParamBean (final HttpParams params) { 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 676d4e0df..7e03f37e7 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 @@ -39,10 +39,10 @@ import org.apache.http.util.Args; * @since 4.0 * * @see ConnManagerPNames - * + * * @deprecated (4.1) use configuration methods of the specific connection manager implementation. */ -@Deprecated +@Deprecated @Immutable public final class ConnManagerParams implements ConnManagerPNames { @@ -59,7 +59,7 @@ public final class ConnManagerParams implements ConnManagerPNames { * @deprecated (4.1) use {@link HttpConnectionParams#getConnectionTimeout(HttpParams)} */ @Deprecated - public static long getTimeout(final HttpParams params) { + public static long getTimeout(final HttpParams params) { Args.notNull(params, "HTTP parameters"); return params.getLongParameter(TIMEOUT, 0); } @@ -74,7 +74,7 @@ public final class ConnManagerParams implements ConnManagerPNames { * @deprecated (4.1) use {@link HttpConnectionParams#setConnectionTimeout(HttpParams, int)} */ @Deprecated - public static void setTimeout(final HttpParams params, long timeout) { + public static void setTimeout(final HttpParams params, long timeout) { Args.notNull(params, "HTTP parameters"); params.setLongParameter(TIMEOUT, timeout); } diff --git a/httpclient/src/main/java/org/apache/http/conn/params/ConnPerRouteBean.java b/httpclient/src/main/java/org/apache/http/conn/params/ConnPerRouteBean.java index 4390ca887..2fa8f1fb6 100644 --- a/httpclient/src/main/java/org/apache/http/conn/params/ConnPerRouteBean.java +++ b/httpclient/src/main/java/org/apache/http/conn/params/ConnPerRouteBean.java @@ -44,7 +44,7 @@ import org.apache.http.util.Args; * * @deprecated (4.2) use {@link ConnPoolControl} */ -@Deprecated +@Deprecated @ThreadSafe public final class ConnPerRouteBean implements ConnPerRoute { diff --git a/httpclient/src/main/java/org/apache/http/conn/scheme/HostNameResolver.java b/httpclient/src/main/java/org/apache/http/conn/scheme/HostNameResolver.java index b2f2f88e6..ea8c71d44 100644 --- a/httpclient/src/main/java/org/apache/http/conn/scheme/HostNameResolver.java +++ b/httpclient/src/main/java/org/apache/http/conn/scheme/HostNameResolver.java @@ -37,7 +37,7 @@ import java.net.InetAddress; * * @deprecated (4.1) Do not use */ -@Deprecated +@Deprecated public interface HostNameResolver { /** diff --git a/httpclient/src/main/java/org/apache/http/conn/scheme/LayeredSchemeSocketFactory.java b/httpclient/src/main/java/org/apache/http/conn/scheme/LayeredSchemeSocketFactory.java index 4a01bd119..dedfe502d 100644 --- a/httpclient/src/main/java/org/apache/http/conn/scheme/LayeredSchemeSocketFactory.java +++ b/httpclient/src/main/java/org/apache/http/conn/scheme/LayeredSchemeSocketFactory.java @@ -35,7 +35,7 @@ import java.net.UnknownHostException; * Extended {@link SchemeSocketFactory} interface for layered sockets such as SSL/TLS. * * @since 4.1 - * + * * @deprecated (4.2) use {@link SchemeLayeredSocketFactory} */ @Deprecated diff --git a/httpclient/src/main/java/org/apache/http/conn/scheme/LayeredSocketFactory.java b/httpclient/src/main/java/org/apache/http/conn/scheme/LayeredSocketFactory.java index 8cc1bc939..9d80d9b06 100644 --- a/httpclient/src/main/java/org/apache/http/conn/scheme/LayeredSocketFactory.java +++ b/httpclient/src/main/java/org/apache/http/conn/scheme/LayeredSocketFactory.java @@ -39,7 +39,7 @@ import java.net.UnknownHostException; * * @deprecated (4.1) use {@link SchemeSocketFactory} */ -@Deprecated +@Deprecated public interface LayeredSocketFactory extends SocketFactory { /** diff --git a/httpclient/src/main/java/org/apache/http/conn/scheme/Scheme.java b/httpclient/src/main/java/org/apache/http/conn/scheme/Scheme.java index aeda0465e..de1bd1f53 100644 --- a/httpclient/src/main/java/org/apache/http/conn/scheme/Scheme.java +++ b/httpclient/src/main/java/org/apache/http/conn/scheme/Scheme.java @@ -119,7 +119,7 @@ public final class Scheme { * * @deprecated (4.1) Use {@link #Scheme(String, int, SchemeSocketFactory)} */ - @Deprecated + @Deprecated public Scheme(final String name, final SocketFactory factory, final int port) { diff --git a/httpclient/src/main/java/org/apache/http/conn/scheme/SchemeLayeredSocketFactoryAdaptor2.java b/httpclient/src/main/java/org/apache/http/conn/scheme/SchemeLayeredSocketFactoryAdaptor2.java index 12c157746..c1d3d9cf7 100644 --- a/httpclient/src/main/java/org/apache/http/conn/scheme/SchemeLayeredSocketFactoryAdaptor2.java +++ b/httpclient/src/main/java/org/apache/http/conn/scheme/SchemeLayeredSocketFactoryAdaptor2.java @@ -38,7 +38,7 @@ import org.apache.http.params.HttpParams; /** * @deprecated (4.2) do not use */ -@Deprecated +@Deprecated class SchemeLayeredSocketFactoryAdaptor2 implements SchemeLayeredSocketFactory { private final LayeredSchemeSocketFactory factory; @@ -53,9 +53,9 @@ class SchemeLayeredSocketFactoryAdaptor2 implements SchemeLayeredSocketFactory { } public Socket connectSocket( - final Socket sock, + final Socket sock, final InetSocketAddress remoteAddress, - final InetSocketAddress localAddress, + final InetSocketAddress localAddress, final HttpParams params) throws IOException, UnknownHostException, ConnectTimeoutException { return this.factory.connectSocket(sock, remoteAddress, localAddress, params); } diff --git a/httpclient/src/main/java/org/apache/http/conn/ssl/SSLInitializationException.java b/httpclient/src/main/java/org/apache/http/conn/ssl/SSLInitializationException.java index defd7e1cd..51e051139 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ssl/SSLInitializationException.java +++ b/httpclient/src/main/java/org/apache/http/conn/ssl/SSLInitializationException.java @@ -32,6 +32,6 @@ public class SSLInitializationException extends IllegalStateException { public SSLInitializationException(final String message, final Throwable cause) { super(message, cause); - } - + } + } diff --git a/httpclient/src/main/java/org/apache/http/cookie/params/CookieSpecPNames.java b/httpclient/src/main/java/org/apache/http/cookie/params/CookieSpecPNames.java index 673bd638e..cc60aaebd 100644 --- a/httpclient/src/main/java/org/apache/http/cookie/params/CookieSpecPNames.java +++ b/httpclient/src/main/java/org/apache/http/cookie/params/CookieSpecPNames.java @@ -33,7 +33,7 @@ import org.apache.http.cookie.CookieSpecProvider; * Parameter names for HTTP cookie management classes. * * @since 4.0 - * + * * @deprecated (4.3) use constructor parameters of {@link CookieSpecProvider}s. */ @Deprecated diff --git a/httpclient/src/main/java/org/apache/http/cookie/params/CookieSpecParamBean.java b/httpclient/src/main/java/org/apache/http/cookie/params/CookieSpecParamBean.java index 17165879b..1b9cfbeb4 100644 --- a/httpclient/src/main/java/org/apache/http/cookie/params/CookieSpecParamBean.java +++ b/httpclient/src/main/java/org/apache/http/cookie/params/CookieSpecParamBean.java @@ -40,7 +40,7 @@ import org.apache.http.params.HttpParams; * conventions. * * @since 4.0 - * + * * @deprecated (4.3) use constructor parameters of {@link CookieSpecProvider}s. */ @Deprecated diff --git a/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java b/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java index 0a775de76..959a1ac82 100644 --- a/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java +++ b/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java @@ -113,7 +113,7 @@ public abstract class GGSSchemeBase extends AuthSchemeBase { /** * @deprecated (4.2) Use {@link ContextAwareAuthScheme#authenticate(Credentials, HttpRequest, org.apache.http.protocol.HttpContext)} */ - @Deprecated + @Deprecated public Header authenticate( final Credentials credentials, final HttpRequest request) throws AuthenticationException { diff --git a/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java b/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java index da369c471..6c39ef4f7 100644 --- a/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java +++ b/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java @@ -1234,7 +1234,7 @@ final class NTLMEngineImpl implements NTLMEngine { // Start the response. Length includes signature and type prepareResponse(finalLength, 3); - + // LM Resp Length (twice) addUShort(lmRespLen); addUShort(lmRespLen); 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 7e9eae717..fefb9a306 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 @@ -84,7 +84,7 @@ public class NegotiateScheme extends GGSSchemeBase { } @Override - public Header authenticate( + 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/auth/NegotiateSchemeFactory.java b/httpclient/src/main/java/org/apache/http/impl/auth/NegotiateSchemeFactory.java index 805acad97..5e3229235 100644 --- a/httpclient/src/main/java/org/apache/http/impl/auth/NegotiateSchemeFactory.java +++ b/httpclient/src/main/java/org/apache/http/impl/auth/NegotiateSchemeFactory.java @@ -38,7 +38,7 @@ import org.apache.http.params.HttpParams; * * @deprecated (4.2) use {@link SPNegoSchemeFactory} or {@link KerberosSchemeFactory}. */ -@Deprecated +@Deprecated public class NegotiateSchemeFactory implements AuthSchemeFactory { private final SpnegoTokenGenerator spengoGenerator; diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AbstractAuthenticationHandler.java b/httpclient/src/main/java/org/apache/http/impl/client/AbstractAuthenticationHandler.java index 3a17e2ff9..33e16acd4 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/AbstractAuthenticationHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/AbstractAuthenticationHandler.java @@ -61,7 +61,7 @@ import org.apache.http.util.CharArrayBuffer; * * @deprecated (4.2) use {@link AuthenticationStrategy} */ -@Deprecated +@Deprecated @Immutable public abstract class AbstractAuthenticationHandler implements AuthenticationHandler { 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 fae4a3c19..7c85b8ced 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 @@ -174,7 +174,7 @@ import org.apache.http.util.Args; * shut down by calling {@link ClientConnectionManager#shutdown()}! * * @since 4.0 - * + * * @deprecated (4.3) use {@link HttpClientBuilder}. */ @ThreadSafe @@ -395,7 +395,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.1) do not use */ - @Deprecated + @Deprecated protected RedirectHandler createRedirectHandler() { return new DefaultRedirectHandler(); } @@ -407,7 +407,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.2) do not use */ - @Deprecated + @Deprecated protected AuthenticationHandler createTargetAuthenticationHandler() { return new DefaultTargetAuthenticationHandler(); } @@ -419,7 +419,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.2) do not use */ - @Deprecated + @Deprecated protected AuthenticationHandler createProxyAuthenticationHandler() { return new DefaultProxyAuthenticationHandler(); } @@ -553,7 +553,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.1) do not use */ - @Deprecated + @Deprecated public synchronized final RedirectHandler getRedirectHandler() { return createRedirectHandler(); } @@ -561,7 +561,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.1) do not use */ - @Deprecated + @Deprecated public synchronized void setRedirectHandler(final RedirectHandler handler) { this.redirectStrategy = new DefaultRedirectStrategyAdaptor(handler); } @@ -586,7 +586,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.2) do not use */ - @Deprecated + @Deprecated public synchronized final AuthenticationHandler getTargetAuthenticationHandler() { return createTargetAuthenticationHandler(); } @@ -594,7 +594,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.2) do not use */ - @Deprecated + @Deprecated public synchronized void setTargetAuthenticationHandler(final AuthenticationHandler handler) { this.targetAuthStrategy = new AuthenticationStrategyAdaptor(handler); } @@ -619,7 +619,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.2) do not use */ - @Deprecated + @Deprecated public synchronized final AuthenticationHandler getProxyAuthenticationHandler() { return createProxyAuthenticationHandler(); } @@ -627,7 +627,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.2) do not use */ - @Deprecated + @Deprecated public synchronized void setProxyAuthenticationHandler(final AuthenticationHandler handler) { this.proxyAuthStrategy = new AuthenticationStrategyAdaptor(handler); } @@ -777,7 +777,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { } @Override - protected final CloseableHttpResponse doExecute(HttpHost target, HttpRequest request, + protected final CloseableHttpResponse doExecute(HttpHost target, HttpRequest request, HttpContext context) throws IOException, ClientProtocolException { @@ -894,7 +894,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient { /** * @deprecated (4.2) do not use */ - @Deprecated + @Deprecated protected RequestDirector createClientRequestDirector( final HttpRequestExecutor requestExec, final ClientConnectionManager conman, 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 fc4f78bf3..c66b4f20d 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 @@ -52,7 +52,7 @@ import org.apache.http.util.EntityUtils; * a non-2xx response using the {@link ServiceUnavailableRetryStrategy} interface. * * @since 4.2 - * + * * @deprecated (4.3) use {@link HttpClientBuilder}. */ @Deprecated diff --git a/httpclient/src/main/java/org/apache/http/impl/client/ClientParamsStack.java b/httpclient/src/main/java/org/apache/http/impl/client/ClientParamsStack.java index 6615d3a17..d354b627d 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/ClientParamsStack.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/ClientParamsStack.java @@ -66,7 +66,7 @@ import org.apache.http.util.Args; * when looking up parameters. * * @since 4.0 - * + * * @deprecated (4.3) use {@link DefaultedHttpParams} */ @NotThreadSafe diff --git a/httpclient/src/main/java/org/apache/http/impl/client/ContentEncodingHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/ContentEncodingHttpClient.java index 3e05fdfa8..0be454cbc 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/ContentEncodingHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/ContentEncodingHttpClient.java @@ -37,7 +37,7 @@ import org.apache.http.protocol.BasicHttpProcessor; /** * {@link DefaultHttpClient} sub-class which includes a {@link RequestAcceptEncoding} * for the request and response. - * + * * Deprecation note: due to the way this class modifies a response body * without changing the response headers to reflect the entity changes, it cannot * be used as the "backend" for a caching {@link HttpClient} and still @@ -47,7 +47,7 @@ import org.apache.http.protocol.BasicHttpProcessor; * responses in compressed or uncompressed form. * * @since 4.1 - * + * * @deprecated (4.2) use {@link HttpClientBuilder} */ @Deprecated diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java index 3d65a642a..57a563337 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java @@ -58,20 +58,20 @@ import org.apache.http.util.EntityUtils; * header on the response to uncompress any compressed response bodies. * The {@link java.io.InputStream} of the entity will contain the uncompressed * content.

- * + * *

N.B. Any upstream clients of this class need to be aware that * this effectively obscures visibility into the length of a server * response body, since the Content-Length header will * correspond to the compressed entity length received from the server, * but the content length experienced by reading the response body may * be different (hopefully higher!).

- * - *

That said, this decorator is compatible with the - * CachingHttpClient in that the two decorators can be added - * in either order and still have cacheable responses be cached.

- * + * + *

That said, this decorator is compatible with the + * CachingHttpClient in that the two decorators can be added + * in either order and still have cacheable responses be cached.

+ * * @since 4.2 - * + * * @deprecated (4.3) use {@link HttpClientBuilder} */ @Deprecated @@ -80,7 +80,7 @@ public class DecompressingHttpClient implements HttpClient { private final HttpClient backend; private final HttpRequestInterceptor acceptEncodingInterceptor; private final HttpResponseInterceptor contentEncodingInterceptor; - + /** * Constructs a decorator to ask for and handle compressed * entities on the fly. @@ -98,9 +98,9 @@ public class DecompressingHttpClient implements HttpClient { public DecompressingHttpClient(HttpClient backend) { this(backend, new RequestAcceptEncoding(), new ResponseContentEncoding()); } - - DecompressingHttpClient(HttpClient backend, - HttpRequestInterceptor requestInterceptor, + + DecompressingHttpClient(HttpClient backend, + HttpRequestInterceptor requestInterceptor, HttpResponseInterceptor responseInterceptor) { this.backend = backend; this.acceptEncodingInterceptor = requestInterceptor; @@ -122,7 +122,7 @@ public class DecompressingHttpClient implements HttpClient { /** * Gets the HttpClient to issue request. - * + * * @return the HttpClient to issue request */ public HttpClient getHttpClient() { 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 b24d36420..56adf88b9 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 @@ -111,7 +111,7 @@ import org.apache.http.util.VersionInfo; * * * @since 4.0 - * + * * @deprecated (4.3) use {@link HttpClientBuilder}. */ @ThreadSafe 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 77a63ef03..d1f7cd309 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 @@ -154,11 +154,11 @@ public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler { /** * @since 4.2 - * + * * @deprecated (4.3) */ @Deprecated - protected boolean requestIsAborted(final HttpRequest request) { + 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/DefaultProxyAuthenticationHandler.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultProxyAuthenticationHandler.java index 554bb5d29..35af5a709 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultProxyAuthenticationHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultProxyAuthenticationHandler.java @@ -49,7 +49,7 @@ import org.apache.http.util.Args; * * @deprecated (4.2) use {@link ProxyAuthenticationStrategy} */ -@Deprecated +@Deprecated @Immutable public class DefaultProxyAuthenticationHandler extends AbstractAuthenticationHandler { diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategyAdaptor.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategyAdaptor.java index 7a592aa48..ee7a8e1e1 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategyAdaptor.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategyAdaptor.java @@ -44,7 +44,7 @@ import org.apache.http.protocol.HttpContext; * @deprecated (4.1) do not use */ @Immutable -@Deprecated +@Deprecated class DefaultRedirectStrategyAdaptor implements RedirectStrategy { private final RedirectHandler handler; diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java index eccf2bb85..068f02acf 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java @@ -128,7 +128,7 @@ import org.apache.http.util.EntityUtils; * * * @since 4.0 - * + * * @deprecated (4.3) */ @Deprecated @@ -1050,7 +1050,7 @@ public class DefaultRequestDirector implements RequestDirector { } } } - + if (HttpClientParams.isRedirecting(params) && this.redirectStrategy.isRedirected(request, response, context)) { diff --git a/httpclient/src/main/java/org/apache/http/impl/client/EntityEnclosingRequestWrapper.java b/httpclient/src/main/java/org/apache/http/impl/client/EntityEnclosingRequestWrapper.java index 3ad0c4504..4d5550592 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/EntityEnclosingRequestWrapper.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/EntityEnclosingRequestWrapper.java @@ -48,10 +48,10 @@ import org.apache.http.protocol.HTTP; * the state of the original request. * * @since 4.0 - * + * * @deprecated (4.3) do not use. */ -@Deprecated +@Deprecated @NotThreadSafe // e.g. [gs]etEntity() public class EntityEnclosingRequestWrapper extends RequestWrapper implements HttpEntityEnclosingRequest { diff --git a/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java b/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java index 9574fc68a..9bcf24254 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java @@ -330,7 +330,7 @@ public class HttpClientBuilder { this.backoffManager = backoffManager; return this; } - + public final HttpClientBuilder setServiceUnavailableRetryStrategy( final ServiceUnavailableRetryStrategy serviceUnavailStrategy) { this.serviceUnavailStrategy = serviceUnavailStrategy; diff --git a/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java index 39f95a063..4c3c0d138 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java @@ -152,7 +152,7 @@ class InternalHttpClient extends CloseableHttpClient { } @Override - protected CloseableHttpResponse doExecute( + protected CloseableHttpResponse doExecute( final HttpHost target, final HttpRequest request, final HttpContext context) throws IOException, ClientProtocolException { diff --git a/httpclient/src/main/java/org/apache/http/impl/client/MinimalHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/MinimalHttpClient.java index 588161947..577eea81a 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/MinimalHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/MinimalHttpClient.java @@ -86,7 +86,7 @@ class MinimalHttpClient extends CloseableHttpClient { } @Override - protected CloseableHttpResponse doExecute( + protected CloseableHttpResponse doExecute( final HttpHost target, final HttpRequest request, final HttpContext context) throws IOException, ClientProtocolException { @@ -109,7 +109,7 @@ class MinimalHttpClient extends CloseableHttpClient { } if (config.getDefaultProxy() != null) { throw new ClientProtocolException("Minimal HttpClient does not support" + - " request execution via proxy"); + " request execution via proxy"); } localcontext.setRequestConfig(config); return this.requestExecutor.execute(route, wrapper, localcontext, execAware); diff --git a/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java b/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java index f07596cab..7c267b616 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java @@ -50,11 +50,11 @@ import org.apache.http.util.Args; * the state of the original request. * * @since 4.0 - * + * * @deprecated (4.3) do not use. */ @NotThreadSafe -@Deprecated +@Deprecated public class RequestWrapper extends AbstractHttpMessage implements HttpUriRequest { private final HttpRequest original; diff --git a/httpclient/src/main/java/org/apache/http/impl/client/RoutedRequest.java b/httpclient/src/main/java/org/apache/http/impl/client/RoutedRequest.java index fdac613f9..43a0a80a0 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/RoutedRequest.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/RoutedRequest.java @@ -34,7 +34,7 @@ import org.apache.http.conn.routing.HttpRoute; * A request with the route along which it should be sent. * * @since 4.0 - * + * * @deprecated (4.3) do not use. */ @Deprecated diff --git a/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java index 795c47676..85e93b957 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java @@ -101,7 +101,7 @@ import org.apache.http.params.HttpParams; *

* * @since 4.2 - * + * * @deprecated (4.3) use {@link HttpClientBuilder} */ @ThreadSafe diff --git a/httpclient/src/main/java/org/apache/http/impl/client/execchain/Proxies.java b/httpclient/src/main/java/org/apache/http/impl/client/execchain/Proxies.java index 063b69aac..1d13ec4b7 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/execchain/Proxies.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/execchain/Proxies.java @@ -90,4 +90,4 @@ class Proxies { new ResponseProxyHandler(original, connReleaseTrigger)); } -} \ No newline at end of file +} diff --git a/httpclient/src/main/java/org/apache/http/impl/client/execchain/RequestEntityExecHandler.java b/httpclient/src/main/java/org/apache/http/impl/client/execchain/RequestEntityExecHandler.java index 89149f256..ff0efb721 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/execchain/RequestEntityExecHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/execchain/RequestEntityExecHandler.java @@ -85,4 +85,4 @@ class RequestEntityExecHandler implements InvocationHandler { } } -} \ No newline at end of file +} diff --git a/httpclient/src/main/java/org/apache/http/impl/client/execchain/ServiceUnavailableRetryExec.java b/httpclient/src/main/java/org/apache/http/impl/client/execchain/ServiceUnavailableRetryExec.java index 58f0f383a..37020218f 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/execchain/ServiceUnavailableRetryExec.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/execchain/ServiceUnavailableRetryExec.java @@ -57,7 +57,7 @@ public class ServiceUnavailableRetryExec implements ClientExecChain { private final ServiceUnavailableRetryStrategy retryStrategy; public ServiceUnavailableRetryExec( - final ClientExecChain requestExecutor, + final ClientExecChain requestExecutor, final ServiceUnavailableRetryStrategy retryStrategy) { super(); Args.notNull(requestExecutor, "HTTP request executor"); @@ -67,7 +67,7 @@ public class ServiceUnavailableRetryExec implements ClientExecChain { } public CloseableHttpResponse execute( - final HttpRoute route, + final HttpRoute route, final HttpRequestWrapper request, final HttpClientContext context, final HttpExecutionAware execAware) throws IOException, HttpException { 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 9b364f7d2..9b5102465 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 @@ -129,7 +129,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti * @deprecated (4.1) use {@link #assertValid(OperatedClientConnection)} */ @Deprecated - protected final void assertNotAborted() throws InterruptedIOException { + 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 7199a0459..dc389f1f7 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 @@ -71,11 +71,11 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte * Obtains the pool entry. * * @return the pool entry, or null if detached - * - * @deprecated (4.0.1) + * + * @deprecated (4.0.1) */ @Deprecated - protected AbstractPoolEntry getPoolEntry() { + protected AbstractPoolEntry getPoolEntry() { return this.poolEntry; } @@ -97,7 +97,7 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte * @deprecated (4.1) use {@link #assertValid(AbstractPoolEntry)} */ @Deprecated - protected final void assertAttached() { + protected final void assertAttached() { if (poolEntry == null) { throw new ConnectionShutdownException(); } diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java b/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java index 38dbc395a..98f564674 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/BasicClientConnectionManager.java @@ -48,7 +48,7 @@ import org.apache.http.util.Asserts; /** * A connection manager for a single connection. This connection manager maintains only one active - * connection. Even though this class is fully thread-safe it ought to be used by one execution + * connection. Even though this class is fully thread-safe it ought to be used by one execution * thread only, as only one thread a time can lease the connection at a time. *

* This connection manager will make an effort to reuse the connection for subsequent requests @@ -186,7 +186,7 @@ public class BasicClientConnectionManager implements ClientConnectionManager { } } } - + public void releaseConnection(final ManagedClientConnection conn, long keepalive, TimeUnit tunit) { Args.check(conn instanceof ManagedClientConnectionImpl, "Connection class mismatch, " + "connection not obtained from this manager"); diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionFactory.java b/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionFactory.java index a226d6086..cb7877c30 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionFactory.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionFactory.java @@ -65,7 +65,7 @@ public class DefaultClientConnectionFactory implements HttpConnectionFactorynull {@link BasicLineParser#INSTANCE} * will be used. - * @param responseFactory HTTP response factory. If null + * @param responseFactory HTTP response factory. If null * {@link DefaultHttpResponseFactory#INSTANCE} will be used. * @param constraints the message constraints. If null * {@link MessageConstraints#DEFAULT} will be used. - * + * * @since 4.3 */ public DefaultHttpResponseParser( @@ -108,7 +108,7 @@ public class DefaultHttpResponseParser extends AbstractMessageParser * * @since 4.0 - * + * * @deprecated (4.2) use {@link DefaultHttpResponseParser} */ @Deprecated diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java b/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java index f10248afa..e263ee93d 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java @@ -485,4 +485,4 @@ public class PoolingHttpClientConnectionManager implements HttpClientConnectionM } -} \ No newline at end of file +} 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 61a5a6586..09a9a44c1 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 @@ -62,7 +62,7 @@ import org.apache.http.util.Asserts; * @deprecated (4.2) use {@link BasicClientConnectionManager} */ @ThreadSafe -@Deprecated +@Deprecated public class SingleClientConnManager implements ClientConnectionManager { private final Log log = LogFactory.getLog(getClass()); @@ -109,7 +109,7 @@ public class SingleClientConnManager implements ClientConnectionManager { * @deprecated (4.1) use {@link SingleClientConnManager#SingleClientConnManager(SchemeRegistry)} */ @Deprecated - public SingleClientConnManager(HttpParams params, + public SingleClientConnManager(HttpParams params, SchemeRegistry schreg) { this(schreg); } diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/Wire.java b/httpclient/src/main/java/org/apache/http/impl/conn/Wire.java index 33e38e9c6..5ba0bc1ab 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/Wire.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/Wire.java @@ -141,7 +141,7 @@ public class Wire { /** * @deprecated (4.1) do not use */ - @Deprecated + @Deprecated public void output(final String s) throws IOException { Args.notNull(s, "Output"); @@ -151,7 +151,7 @@ public class Wire { /** * @deprecated (4.1) do not use */ - @Deprecated + @Deprecated public void input(final String s) throws IOException { Args.notNull(s, "Input"); diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java index 5decc22ff..598b3d5c1 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java @@ -41,7 +41,7 @@ import org.apache.http.util.Args; * * @deprecated (4.2) do not use */ -@Deprecated +@Deprecated public class BasicPoolEntryRef extends WeakReference { /** The planned route of the entry. */ diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPooledConnAdapter.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPooledConnAdapter.java index 98bc1af02..6cbd73512 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPooledConnAdapter.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/BasicPooledConnAdapter.java @@ -39,7 +39,7 @@ import org.apache.http.impl.conn.AbstractPooledConnAdapter; * * @deprecated (4.2) do not use */ -@Deprecated +@Deprecated public class BasicPooledConnAdapter extends AbstractPooledConnAdapter { /** 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 002253d0e..db3cb1dd0 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 @@ -67,7 +67,7 @@ import org.apache.http.util.Asserts; * * @deprecated (4.2) use {@link org.apache.http.pool.AbstractConnPool} */ -@Deprecated +@Deprecated public class ConnPoolByRoute extends AbstractConnPool { private final Log log = LogFactory.getLog(getClass()); @@ -148,7 +148,7 @@ public class ConnPoolByRoute extends AbstractConnPool { * @deprecated (4.1) use {@link ConnPoolByRoute#ConnPoolByRoute(ClientConnectionOperator, ConnPerRoute, int)} */ @Deprecated - public ConnPoolByRoute(final ClientConnectionOperator operator, final HttpParams params) { + 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/PoolEntryRequest.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java index 9e750d6d4..df23103a5 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java @@ -38,7 +38,7 @@ import org.apache.http.conn.ConnectionPoolTimeoutException; * * @deprecated (4.2) use {@link Future} */ -@Deprecated +@Deprecated public interface PoolEntryRequest { /** 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 b8d576ac4..e08685379 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 @@ -80,7 +80,7 @@ public class RouteSpecificPool { * @deprecated (4.1) use {@link RouteSpecificPool#RouteSpecificPool(HttpRoute, ConnPerRoute)} */ @Deprecated - public RouteSpecificPool(HttpRoute route, int maxEntries) { + 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 be69e9fb4..b93e4540d 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 @@ -69,7 +69,7 @@ import org.apache.http.util.Asserts; * @deprecated (4.2) use {@link PoolingClientConnectionManager} */ @ThreadSafe -@Deprecated +@Deprecated public class ThreadSafeClientConnManager implements ClientConnectionManager { private final Log log; @@ -150,7 +150,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager { * @deprecated (4.1) use {@link ThreadSafeClientConnManager#ThreadSafeClientConnManager(SchemeRegistry)} */ @Deprecated - public ThreadSafeClientConnManager(HttpParams params, + public ThreadSafeClientConnManager(HttpParams params, SchemeRegistry schreg) { Args.notNull(schreg, "Scheme registry"); this.log = LogFactory.getLog(getClass()); @@ -178,7 +178,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager { * @deprecated (4.1) use #createConnectionPool(long, TimeUnit)) */ @Deprecated - protected AbstractConnPool createConnectionPool(final HttpParams params) { + protected AbstractConnPool createConnectionPool(final HttpParams params) { return new ConnPoolByRoute(connOperator, params); } diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java index baca9981f..71dc6f3e8 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java @@ -47,7 +47,7 @@ import org.apache.http.util.Args; * * @deprecated (4.2) do not use */ -@Deprecated +@Deprecated public class WaitingThread { /** The condition on which the thread is waiting. */ diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java index d6b53041e..a945ce07d 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java @@ -35,7 +35,7 @@ package org.apache.http.impl.conn.tsccm; * * @deprecated (4.2) do not use */ -@Deprecated +@Deprecated public class WaitingThreadAborter { private WaitingThread waitingThread; diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatVersionAttributeHandler.java b/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatVersionAttributeHandler.java index 2043a17e5..3395f966c 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatVersionAttributeHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatVersionAttributeHandler.java @@ -39,28 +39,28 @@ import org.apache.http.util.Args; */ @Immutable public class BrowserCompatVersionAttributeHandler extends - AbstractCookieAttributeHandler { + AbstractCookieAttributeHandler { - public BrowserCompatVersionAttributeHandler() { - super(); - } + public BrowserCompatVersionAttributeHandler() { + super(); + } - /** - * Parse cookie version attribute. - */ - public void parse(final SetCookie cookie, final String value) - throws MalformedCookieException { - Args.notNull(cookie, "Cookie"); - if (value == null) { - throw new MalformedCookieException("Missing value for version attribute"); - } - int version = 0; - try { - version = Integer.parseInt(value); - } catch (NumberFormatException e) { - // Just ignore invalid versions - } - cookie.setVersion(version); - } + /** + * Parse cookie version attribute. + */ + public void parse(final SetCookie cookie, final String value) + throws MalformedCookieException { + Args.notNull(cookie, "Cookie"); + if (value == null) { + throw new MalformedCookieException("Missing value for version attribute"); + } + int version = 0; + try { + version = Integer.parseInt(value); + } catch (NumberFormatException e) { + // Just ignore invalid versions + } + cookie.setVersion(version); + } } diff --git a/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseAuthCache.java b/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseAuthCache.java index 18a7fd056..f66fabb30 100644 --- a/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseAuthCache.java +++ b/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseAuthCache.java @@ -48,7 +48,7 @@ import org.apache.http.protocol.HttpContext; import org.junit.Before; import org.junit.Test; -@Deprecated +@Deprecated public class TestResponseAuthCache { private HttpHost target; diff --git a/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java b/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java index 1e27de2d7..2fc573e63 100644 --- a/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java +++ b/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java @@ -192,9 +192,9 @@ public class TestURIBuilder { .build(); Assert.assertEquals(uri.getHost(), bld.getHost()); - + Assert.assertEquals(uri.getUserInfo(), bld.getUserInfo()); - + Assert.assertEquals(uri.getPath(), bld.getPath()); Assert.assertEquals(uri.getQuery(), bld.getQuery()); @@ -221,9 +221,9 @@ public class TestURIBuilder { .build(); Assert.assertEquals(uri.getHost(), bld.getHost()); - + Assert.assertEquals(uri.getRawUserInfo(), bld.getRawUserInfo()); - + Assert.assertEquals(uri.getRawPath(), bld.getRawPath()); Assert.assertEquals(uri.getRawQuery(), bld.getRawQuery()); diff --git a/httpclient/src/test/java/org/apache/http/impl/auth/TestNTLMEngineImpl.java b/httpclient/src/test/java/org/apache/http/impl/auth/TestNTLMEngineImpl.java index ec3818c31..e21d14e8c 100644 --- a/httpclient/src/test/java/org/apache/http/impl/auth/TestNTLMEngineImpl.java +++ b/httpclient/src/test/java/org/apache/http/impl/auth/TestNTLMEngineImpl.java @@ -200,7 +200,7 @@ public class TestNTLMEngineImpl { public void testType1Message() throws Exception { new NTLMEngineImpl().getType1Message("myhost", "mydomain"); } - + @Test public void testType3Message() throws Exception { new NTLMEngineImpl().getType3Message("me", "mypassword", "myhost", "mydomain", @@ -213,7 +213,7 @@ public class TestNTLMEngineImpl { "mytarget", toBytes("02000c0044004f004d00410049004e0001000c005300450052005600450052000400140064006f006d00610069006e002e0063006f006d00030022007300650072007600650072002e0064006f006d00610069006e002e0063006f006d0000000000")); } - + @Test public void testRC4() throws Exception { checkArraysMatch(toBytes("e37f97f2544f4d7e"), diff --git a/httpclient/src/test/java/org/apache/http/impl/client/DummyHttpClient.java b/httpclient/src/test/java/org/apache/http/impl/client/DummyHttpClient.java index 7ea9ca011..bf3292a5c 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/DummyHttpClient.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/DummyHttpClient.java @@ -51,11 +51,11 @@ public class DummyHttpClient implements HttpClient { private ClientConnectionManager connManager = new SingleClientConnManager(); private HttpRequest request; private HttpResponse response = new BasicHttpResponse(new ProtocolVersion("HTTP",1,1), HttpStatus.SC_OK, "OK"); - + public void setParams(HttpParams params) { this.params = params; } - + public HttpParams getParams() { return params; } @@ -63,15 +63,15 @@ public class DummyHttpClient implements HttpClient { public ClientConnectionManager getConnectionManager() { return connManager; } - + public void setConnectionManager(ClientConnectionManager ccm) { connManager = ccm; } - + public void setResponse(HttpResponse resp) { response = resp; } - + public HttpRequest getCapturedRequest() { return request; } diff --git a/httpclient/src/test/java/org/apache/http/impl/client/TestDecompressingHttpClient.java b/httpclient/src/test/java/org/apache/http/impl/client/TestDecompressingHttpClient.java index 2922210af..d53f93776 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/TestDecompressingHttpClient.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/TestDecompressingHttpClient.java @@ -73,7 +73,7 @@ import org.mockito.runners.MockitoJUnitRunner; @Deprecated @RunWith(MockitoJUnitRunner.class) public class TestDecompressingHttpClient { - + private DummyHttpClient backend; @Mock private ClientConnectionManager mockConnManager; @Mock private ResponseHandler mockHandler; @@ -84,7 +84,7 @@ public class TestDecompressingHttpClient { @Mock private HttpResponse mockResponse; @Mock private HttpEntity mockEntity; private Object handled; - + @Before public void canCreate() { handled = new Object(); @@ -95,61 +95,61 @@ public class TestDecompressingHttpClient { ctx = new BasicHttpContext(); host = new HttpHost("www.example.com"); } - + @Test public void isAnHttpClient() { assertTrue(impl instanceof HttpClient); } - + @Test public void usesParamsFromBackend() { HttpParams params = new BasicHttpParams(); backend.setParams(params); assertSame(params, impl.getParams()); } - + @Test public void extractsHostNameFromUriRequest() { - assertEquals(new HttpHost("www.example.com"), + assertEquals(new HttpHost("www.example.com"), impl.getHttpHost(new HttpGet("http://www.example.com/"))); } - + @Test public void extractsHostNameAndPortFromUriRequest() { - assertEquals(new HttpHost("www.example.com", 8080), + assertEquals(new HttpHost("www.example.com", 8080), impl.getHttpHost(new HttpGet("http://www.example.com:8080/"))); } @Test public void extractsIPAddressFromUriRequest() { - assertEquals(new HttpHost("10.0.0.1"), + assertEquals(new HttpHost("10.0.0.1"), impl.getHttpHost(new HttpGet("http://10.0.0.1/"))); } @Test public void extractsIPAddressAndPortFromUriRequest() { - assertEquals(new HttpHost("10.0.0.1", 8080), + assertEquals(new HttpHost("10.0.0.1", 8080), impl.getHttpHost(new HttpGet("http://10.0.0.1:8080/"))); } @Test public void extractsLocalhostFromUriRequest() { - assertEquals(new HttpHost("localhost"), + assertEquals(new HttpHost("localhost"), impl.getHttpHost(new HttpGet("http://localhost/"))); } @Test public void extractsLocalhostAndPortFromUriRequest() { - assertEquals(new HttpHost("localhost", 8080), + assertEquals(new HttpHost("localhost", 8080), impl.getHttpHost(new HttpGet("http://localhost:8080/"))); } - + @Test public void usesConnectionManagerFromBackend() { backend.setConnectionManager(mockConnManager); assertSame(mockConnManager, impl.getConnectionManager()); } - + private void assertAcceptEncodingGzipAndDeflateWereAddedToRequest(HttpRequest captured) { boolean foundGzip = false; boolean foundDeflate = false; @@ -162,7 +162,7 @@ public class TestDecompressingHttpClient { assertTrue(foundGzip); assertTrue(foundDeflate); } - + @Test public void addsAcceptEncodingHeaderToHttpUriRequest() throws Exception { impl.execute(request); @@ -174,19 +174,19 @@ public class TestDecompressingHttpClient { impl.execute(request, ctx); assertAcceptEncodingGzipAndDeflateWereAddedToRequest(backend.getCapturedRequest()); } - + @Test public void addsAcceptEncodingHeaderToHostAndHttpRequest() throws Exception { impl.execute(host, request); assertAcceptEncodingGzipAndDeflateWereAddedToRequest(backend.getCapturedRequest()); } - + @Test public void addsAcceptEncodingHeaderToHostAndHttpRequestWithContext() throws Exception { impl.execute(host, request, ctx); assertAcceptEncodingGzipAndDeflateWereAddedToRequest(backend.getCapturedRequest()); } - + @Test public void addsAcceptEncodingHeaderToUriRequestWithHandler() throws Exception { when(mockHandler.handleResponse(isA(HttpResponse.class))).thenReturn(new Object()); @@ -223,35 +223,35 @@ public class TestDecompressingHttpClient { when(mockResponse.getLastHeader("Content-Encoding")).thenReturn(null); when(mockResponse.getEntity()).thenReturn(mockEntity); } - + @Test public void doesNotModifyResponseBodyIfNoContentEncoding() throws Exception { mockResponseHasNoContentEncodingHeaders(); assertSame(mockResponse, impl.execute(request)); verify(mockResponse, never()).setEntity(any(HttpEntity.class)); } - + @Test public void doesNotModifyResponseBodyIfNoContentEncodingWithContext() throws Exception { mockResponseHasNoContentEncodingHeaders(); assertSame(mockResponse, impl.execute(request, ctx)); verify(mockResponse, never()).setEntity(any(HttpEntity.class)); } - + @Test public void doesNotModifyResponseBodyIfNoContentEncodingForHostRequest() throws Exception { mockResponseHasNoContentEncodingHeaders(); assertSame(mockResponse, impl.execute(host, request)); verify(mockResponse, never()).setEntity(any(HttpEntity.class)); } - + @Test public void doesNotModifyResponseBodyIfNoContentEncodingForHostRequestWithContext() throws Exception { mockResponseHasNoContentEncodingHeaders(); assertSame(mockResponse, impl.execute(host, request, ctx)); verify(mockResponse, never()).setEntity(any(HttpEntity.class)); } - + @Test public void doesNotModifyResponseBodyWithHandlerIfNoContentEncoding() throws Exception { mockResponseHasNoContentEncodingHeaders(); @@ -259,7 +259,7 @@ public class TestDecompressingHttpClient { assertSame(handled, impl.execute(request, mockHandler)); verify(mockResponse, never()).setEntity(any(HttpEntity.class)); } - + @Test public void doesNotModifyResponseBodyWithHandlerAndContextIfNoContentEncoding() throws Exception { mockResponseHasNoContentEncodingHeaders(); @@ -267,7 +267,7 @@ public class TestDecompressingHttpClient { assertSame(handled, impl.execute(request, mockHandler, ctx)); verify(mockResponse, never()).setEntity(any(HttpEntity.class)); } - + @Test public void doesNotModifyResponseBodyWithHostAndHandlerIfNoContentEncoding() throws Exception { mockResponseHasNoContentEncodingHeaders(); @@ -275,7 +275,7 @@ public class TestDecompressingHttpClient { assertSame(handled, impl.execute(host, request, mockHandler)); verify(mockResponse, never()).setEntity(any(HttpEntity.class)); } - + @Test public void doesNotModifyResponseBodyWithHostAndHandlerAndContextIfNoContentEncoding() throws Exception { mockResponseHasNoContentEncodingHeaders(); @@ -283,13 +283,13 @@ public class TestDecompressingHttpClient { assertSame(handled, impl.execute(host, request, mockHandler, ctx)); verify(mockResponse, never()).setEntity(any(HttpEntity.class)); } - + @Test public void successfullyUncompressesContent() throws Exception { final String plainText = "hello\n"; HttpResponse response = getGzippedResponse(plainText); backend.setResponse(response); - + HttpResponse result = impl.execute(request); ByteArrayOutputStream resultBuf = new ByteArrayOutputStream(); InputStream is = result.getEntity().getContent(); @@ -300,13 +300,13 @@ public class TestDecompressingHttpClient { is.close(); assertEquals(plainText, new String(resultBuf.toByteArray())); } - + @Test public void uncompressedResponseHasUnknownLength() throws Exception { final String plainText = "hello\n"; HttpResponse response = getGzippedResponse(plainText); backend.setResponse(response); - + HttpResponse result = impl.execute(request); HttpEntity entity = result.getEntity(); assertEquals(-1, entity.getContentLength()); @@ -319,22 +319,22 @@ public class TestDecompressingHttpClient { final String plainText = "hello\n"; HttpResponse response = getGzippedResponse(plainText); backend.setResponse(response); - + HttpResponse result = impl.execute(request); assertNull(result.getFirstHeader("Content-Encoding")); } - + @Test public void uncompressedResponseHasContentMD5Removed() throws Exception { final String plainText = "hello\n"; HttpResponse response = getGzippedResponse(plainText); response.setHeader("Content-MD5","a checksum"); backend.setResponse(response); - + HttpResponse result = impl.execute(request); assertNull(result.getFirstHeader("Content-MD5")); } - + @Test public void unencodedResponseRetainsContentMD5() throws Exception { final String plainText = "hello\n"; @@ -342,20 +342,20 @@ public class TestDecompressingHttpClient { response.setHeader("Content-MD5","a checksum"); response.setEntity(new ByteArrayEntity(plainText.getBytes())); backend.setResponse(response); - + HttpResponse result = impl.execute(request); assertNotNull(result.getFirstHeader("Content-MD5")); } - + @Test public void passesThroughTheBodyOfAPOST() throws Exception { - when(mockHandler.handleResponse(isA(HttpResponse.class))).thenReturn(new Object()); - HttpPost post = new HttpPost("http://localhost:8080/"); - post.setEntity(new ByteArrayEntity("hello".getBytes())); - impl.execute(host, post, mockHandler, ctx); - assertNotNull(((HttpEntityEnclosingRequest)backend.getCapturedRequest()).getEntity()); + when(mockHandler.handleResponse(isA(HttpResponse.class))).thenReturn(new Object()); + HttpPost post = new HttpPost("http://localhost:8080/"); + post.setEntity(new ByteArrayEntity("hello".getBytes())); + impl.execute(host, post, mockHandler, ctx); + assertNotNull(((HttpEntityEnclosingRequest)backend.getCapturedRequest()).getEntity()); } - + private HttpResponse getGzippedResponse(final String plainText) throws IOException { HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK"); diff --git a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java index 4ec1a801d..9df0f8e75 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestSPNegoScheme.java @@ -156,7 +156,7 @@ public class TestSPNegoScheme extends IntegrationTestBase { HttpHost target = new HttpHost("localhost", port); AuthSchemeProvider nsf = new NegotiateSchemeProviderWithMockGssManager(); - CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); + CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); Credentials use_jaas_creds = new UseJaasCredentials(); credentialsProvider.setCredentials(new AuthScope(null, -1, null), use_jaas_creds); @@ -164,7 +164,7 @@ public class TestSPNegoScheme extends IntegrationTestBase { .registerAuthScheme(AuthSchemes.SPNEGO, nsf) .setCredentialsProvider(credentialsProvider) .build(); - + String s = "/path"; HttpGet httpget = new HttpGet(s); HttpResponse response = this.httpclient.execute(target, httpget); @@ -186,15 +186,15 @@ public class TestSPNegoScheme extends IntegrationTestBase { AuthSchemeProvider nsf = new NegotiateSchemeProviderWithMockGssManager(); - CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); + CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); Credentials use_jaas_creds = new UseJaasCredentials(); credentialsProvider.setCredentials(new AuthScope(null, -1, null), use_jaas_creds); - + this.httpclient = HttpClients.custom() .registerAuthScheme(AuthSchemes.SPNEGO, nsf) .setCredentialsProvider(credentialsProvider) .build(); - + String s = "/path"; HttpGet httpget = new HttpGet(s); HttpResponse response = this.httpclient.execute(target, httpget); diff --git a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestStatefulConnManagement.java b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestStatefulConnManagement.java index a80f318fb..37fbd7d9c 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestStatefulConnManagement.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestStatefulConnManagement.java @@ -98,7 +98,7 @@ public class TestStatefulConnManagement extends IntegrationTestBase { } }; - + this.httpclient = HttpClients.custom() .setConnectionManager(mgr) .setUserTokenHandler(userTokenHandler) @@ -233,7 +233,7 @@ public class TestStatefulConnManagement extends IntegrationTestBase { .setConnectionManager(connMngr) .setUserTokenHandler(userTokenHandler) .build(); - + // Bottom of the pool : a *keep alive* connection to Route 1. HttpContext context1 = new BasicHttpContext(); context1.setAttribute("user", "stuff"); diff --git a/httpclient/src/test/java/org/apache/http/impl/conn/SessionInputBufferMock.java b/httpclient/src/test/java/org/apache/http/impl/conn/SessionInputBufferMock.java index 9a9630124..c2844c492 100644 --- a/httpclient/src/test/java/org/apache/http/impl/conn/SessionInputBufferMock.java +++ b/httpclient/src/test/java/org/apache/http/impl/conn/SessionInputBufferMock.java @@ -46,8 +46,8 @@ public class SessionInputBufferMock extends SessionInputBufferImpl { public static final int BUFFER_SIZE = 16; public SessionInputBufferMock( - final InputStream instream, - int buffersize, + final InputStream instream, + int buffersize, final MessageConstraints constrains, final CharsetDecoder decoder) { super(new HttpTransportMetricsImpl(), buffersize, -1, constrains, decoder); @@ -92,7 +92,7 @@ public class SessionInputBufferMock extends SessionInputBufferImpl { } public SessionInputBufferMock( - final byte[] bytes, + final byte[] bytes, final CharsetDecoder decoder) { this(bytes, BUFFER_SIZE, null, decoder); } diff --git a/httpclient/src/test/java/org/apache/http/localserver/LocalServerTestBase.java b/httpclient/src/test/java/org/apache/http/localserver/LocalServerTestBase.java index 8b0411548..fec1494fe 100644 --- a/httpclient/src/test/java/org/apache/http/localserver/LocalServerTestBase.java +++ b/httpclient/src/test/java/org/apache/http/localserver/LocalServerTestBase.java @@ -57,7 +57,7 @@ public abstract class LocalServerTestBase { localServer.setTimeout(5000); localServer.start(); } - + /** * Obtains the address of the local test server. * diff --git a/httpmime/pom.xml b/httpmime/pom.xml index 277c4e0ca..b03956906 100644 --- a/httpmime/pom.xml +++ b/httpmime/pom.xml @@ -43,7 +43,8 @@ org.apache.httpcomponents - httpcore + httpclient + ${project.version} compile