Make private immutable variables final

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@939845 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2010-04-30 22:18:38 +00:00
parent 77dc3b08a5
commit 529a3e67fc
5 changed files with 11 additions and 10 deletions

View File

@ -41,19 +41,20 @@ import org.apache.http.client.cache.HttpCache;
*/
public class BasicHttpCache implements HttpCache<CacheEntry> {
private LinkedHashMap<String, CacheEntry> baseMap = new LinkedHashMap<String, CacheEntry>(20,
private final LinkedHashMap<String, CacheEntry> baseMap = new LinkedHashMap<String, CacheEntry>(20,
0.75f, true) {
private static final long serialVersionUID = -7750025207539768511L;
@Override
protected boolean removeEldestEntry(Map.Entry<String, CacheEntry> eldest) {
return size() > maxEntries;
}
};
private Map<String, CacheEntry> syncMap;
private final Map<String, CacheEntry> syncMap;
private int maxEntries;
private final int maxEntries;
public BasicHttpCache(int maxEntries) {
this.maxEntries = maxEntries;

View File

@ -43,8 +43,8 @@ import org.apache.http.client.cache.HttpCache;
*/
public class CacheInvalidator {
private HttpCache<CacheEntry> cache;
private URIExtractor uriExtractor;
private final HttpCache<CacheEntry> cache;
private final URIExtractor uriExtractor;
private static final Log LOG = LogFactory.getLog(CacheInvalidator.class);

View File

@ -36,8 +36,8 @@ import java.io.InputStream;
*/
class CombinedInputStream extends InputStream {
private InputStream inputStream1;
private InputStream inputStream2;
private final InputStream inputStream1;
private final InputStream inputStream2;
/**
*

View File

@ -43,7 +43,7 @@ import org.apache.http.impl.cookie.DateUtils;
*/
public class ResponseCachingPolicy {
private int maxObjectSizeBytes;
private final int maxObjectSizeBytes;
private static final Log LOG = LogFactory.getLog(ResponseCachingPolicy.class);
public ResponseCachingPolicy(int maxObjectSizeBytes) {

View File

@ -42,8 +42,8 @@ import org.apache.http.message.BasicHttpResponse;
*/
public class SizeLimitedResponseReader {
private int maxResponseSizeBytes;
private HttpResponse response;
private final int maxResponseSizeBytes;
private final HttpResponse response;
ByteArrayOutputStream outputStream;
InputStream contentInputStream;