Add final modifier to private fields.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1432552 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
323adda52e
commit
3a073e8ed8
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -198,7 +198,7 @@ public class DefaultRequestDirector implements RequestDirector {
|
|||
|
||||
private int redirectCount;
|
||||
|
||||
private int maxRedirects;
|
||||
private final int maxRedirects;
|
||||
|
||||
private HttpHost virtualHost;
|
||||
|
||||
|
|
|
@ -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<String, InetAddress[]> dnsMap;
|
||||
private final Map<String, InetAddress[]> dnsMap;
|
||||
|
||||
/**
|
||||
* Builds a DNS resolver that will resolve the host names against a
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue