Make instance fields final so they are guaranteed to be published
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@652726 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0f26ebe939
commit
4794436347
|
@ -103,10 +103,10 @@ public class ClientMultiThreadedExecution {
|
|||
*/
|
||||
static class GetThread extends Thread {
|
||||
|
||||
private HttpClient httpClient;
|
||||
private HttpContext context;
|
||||
private HttpGet httpget;
|
||||
private int id;
|
||||
private final HttpClient httpClient;
|
||||
private final HttpContext context;
|
||||
private final HttpGet httpget;
|
||||
private final int id;
|
||||
|
||||
public GetThread(HttpClient httpClient, HttpGet httpget, int id) {
|
||||
this.httpClient = httpClient;
|
||||
|
|
|
@ -73,16 +73,16 @@ public class AuthScope {
|
|||
public static final AuthScope ANY = new AuthScope(ANY_HOST, ANY_PORT, ANY_REALM, ANY_SCHEME);
|
||||
|
||||
/** The authentication scheme the credentials apply to. */
|
||||
private String scheme = null;
|
||||
private final String scheme;
|
||||
|
||||
/** The realm the credentials apply to. */
|
||||
private String realm = null;
|
||||
private final String realm;
|
||||
|
||||
/** The host the credentials apply to. */
|
||||
private String host = null;
|
||||
private final String host;
|
||||
|
||||
/** The port the credentials apply to. */
|
||||
private int port = -1;
|
||||
private final int port;
|
||||
|
||||
/** Creates a new credentials scope for the given
|
||||
* <tt>host</tt>, <tt>port</tt>, <tt>realm</tt>, and
|
||||
|
|
|
@ -51,10 +51,10 @@ import org.apache.http.protocol.ExecutionContext;
|
|||
public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler {
|
||||
|
||||
/** the number of times a method will be retried */
|
||||
private int retryCount;
|
||||
private final int retryCount;
|
||||
|
||||
/** Whether or not methods that have successfully sent their request will be retried */
|
||||
private boolean requestSentRetryEnabled;
|
||||
private final boolean requestSentRetryEnabled;
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
|
|
|
@ -53,7 +53,7 @@ public class IdleConnectionHandler {
|
|||
private final Log LOG = LogFactory.getLog(IdleConnectionHandler.class);
|
||||
|
||||
/** Holds connections and the time they were added. */
|
||||
private Map<HttpConnection,Long> connectionToAdded;
|
||||
private final Map<HttpConnection,Long> connectionToAdded;
|
||||
|
||||
|
||||
public IdleConnectionHandler() {
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.apache.commons.logging.Log;
|
|||
*/
|
||||
public class Wire {
|
||||
|
||||
private Log log;
|
||||
private final Log log;
|
||||
|
||||
public Wire(Log log) {
|
||||
this.log = log;
|
||||
|
|
Loading…
Reference in New Issue