diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java index 8e6b5bfc1..d0e7acfda 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/WarningValue.java @@ -45,7 +45,7 @@ class WarningValue { private int offs; private int init_offs; - private String src; + private final String src; private int warnCode; private String warnAgent; private String warnText; diff --git a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/PrefixKeyHashingScheme.java b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/PrefixKeyHashingScheme.java index bc6ade320..5ce9d20b9 100644 --- a/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/PrefixKeyHashingScheme.java +++ b/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/memcached/PrefixKeyHashingScheme.java @@ -35,8 +35,8 @@ package org.apache.http.impl.client.cache.memcached; */ public class PrefixKeyHashingScheme implements KeyHashingScheme { - private String prefix; - private KeyHashingScheme backingScheme; + private final String prefix; + private final KeyHashingScheme backingScheme; /** * Creates a new {@link KeyHashingScheme} that prepends the given diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ConsumableInputStream.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ConsumableInputStream.java index 1bdb53fe3..e247eb550 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ConsumableInputStream.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ConsumableInputStream.java @@ -32,7 +32,7 @@ import java.io.InputStream; public class ConsumableInputStream extends InputStream { - private ByteArrayInputStream buf; + private final ByteArrayInputStream buf; private boolean closed = false; public ConsumableInputStream(ByteArrayInputStream buf) { diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java index 4bfb65fa5..4fc0598af 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java @@ -31,7 +31,7 @@ import org.easymock.IArgumentMatcher; public class RequestEquivalent implements IArgumentMatcher { - private HttpRequest expected; + private final HttpRequest expected; public RequestEquivalent(HttpRequest expected) { this.expected = expected; diff --git a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java index 0027abd91..1bbc81774 100644 --- a/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java +++ b/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolDeviations.java @@ -75,7 +75,7 @@ public class TestProtocolDeviations { private static final int MAX_BYTES = 1024; private static final int MAX_ENTRIES = 100; - private int entityLength = 128; + private final int entityLength = 128; private HttpHost host; private HttpRoute route; 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 69b7ebccd..349f38d72 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 @@ -49,7 +49,7 @@ public class TestResponseCachingPolicy { private ResponseCachingPolicy policy; private HttpResponse response; private HttpRequest request; - private int[] acceptableCodes = new int[] { HttpStatus.SC_OK, + private final int[] acceptableCodes = new int[] { HttpStatus.SC_OK, HttpStatus.SC_NON_AUTHORITATIVE_INFORMATION, HttpStatus.SC_MULTIPLE_CHOICES, HttpStatus.SC_MOVED_PERMANENTLY, HttpStatus.SC_GONE }; private Date now; 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 4b55468d6..9c815609d 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 @@ -198,7 +198,7 @@ public class DefaultRequestDirector implements RequestDirector { private int redirectCount; - private int maxRedirects; + private final int maxRedirects; private HttpHost virtualHost; diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java b/httpclient/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java index 1ad84c530..2a6ca25f8 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/InMemoryDnsResolver.java @@ -51,7 +51,7 @@ public class InMemoryDnsResolver implements DnsResolver { * In-memory collection that will hold the associations between a host name * and an array of InetAddress instances. */ - private Map dnsMap; + private final Map dnsMap; /** * Builds a DNS resolver that will resolve the host names against a diff --git a/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java b/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java index 0b5e169b8..a63081d2d 100644 --- a/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java +++ b/httpclient/src/test/java/org/apache/http/client/utils/TestURIUtils.java @@ -38,7 +38,7 @@ import org.junit.Test; */ public class TestURIUtils { - private URI baseURI = URI.create("http://a/b/c/d;p?q"); + private final URI baseURI = URI.create("http://a/b/c/d;p?q"); @Test public void testRewrite() throws Exception { diff --git a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java index 85d63d62f..e52795daa 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java @@ -325,8 +325,8 @@ public class TestAbortHandling extends IntegrationTestBase { } private static class BasicRedirectService implements HttpRequestHandler { - private int statuscode = HttpStatus.SC_SEE_OTHER; - private int port; + private final int statuscode = HttpStatus.SC_SEE_OTHER; + private final int port; public BasicRedirectService(int port) { this.port = port; diff --git a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java index 242b5be5d..7de3cd3a8 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java @@ -331,7 +331,7 @@ public class TestClientAuthentication extends IntegrationTestBase { static class TestTargetAuthenticationStrategy extends TargetAuthenticationStrategy { - private AtomicLong count; + private final AtomicLong count; public TestTargetAuthenticationStrategy() { super(); @@ -424,7 +424,7 @@ public class TestClientAuthentication extends IntegrationTestBase { static class CountingAuthHandler implements HttpRequestHandler { - private AtomicLong count; + private final AtomicLong count; public CountingAuthHandler() { super(); diff --git a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java index 00fb0b02c..3d88537f4 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java @@ -99,7 +99,7 @@ public class TestClientReauthentication extends IntegrationTestBase { static class AuthHandler implements HttpRequestHandler { - private AtomicLong count = new AtomicLong(0); + private final AtomicLong count = new AtomicLong(0); public void handle( final HttpRequest request, diff --git a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java index bad1084f5..9ba930673 100644 --- a/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java +++ b/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java @@ -186,7 +186,7 @@ public class TestRedirects extends IntegrationTestBase { } private static class BogusRedirectService implements HttpRequestHandler { - private String url; + private final String url; public BogusRedirectService(String redirectUrl) { super();