Add JCIP annotations

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@755466 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-03-18 03:37:07 +00:00
parent 12545d7a13
commit fe0e5e9654
72 changed files with 234 additions and 4 deletions

View File

@ -30,12 +30,15 @@
package org.apache.http.client; package org.apache.http.client;
import net.jcip.annotations.Immutable;
/** /**
* Signals a circular redirect * Signals a circular redirect
* *
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class CircularRedirectException extends RedirectException { public class CircularRedirectException extends RedirectException {
private static final long serialVersionUID = 6830063487001091803L; private static final long serialVersionUID = 6830063487001091803L;

View File

@ -32,11 +32,14 @@ package org.apache.http.client;
import java.io.IOException; import java.io.IOException;
import net.jcip.annotations.Immutable;
/** /**
* Signals an error in the HTTP protocol. * Signals an error in the HTTP protocol.
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class ClientProtocolException extends IOException { public class ClientProtocolException extends IOException {
private static final long serialVersionUID = -5596590843227115865L; private static final long serialVersionUID = -5596590843227115865L;

View File

@ -30,11 +30,14 @@
package org.apache.http.client; package org.apache.http.client;
import net.jcip.annotations.Immutable;
/** /**
* Signals a non 2xx HTTP response. * Signals a non 2xx HTTP response.
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class HttpResponseException extends ClientProtocolException { public class HttpResponseException extends ClientProtocolException {
private static final long serialVersionUID = -7186627969477257933L; private static final long serialVersionUID = -7186627969477257933L;

View File

@ -30,6 +30,8 @@
package org.apache.http.client; package org.apache.http.client;
import net.jcip.annotations.Immutable;
import org.apache.http.ProtocolException; import org.apache.http.ProtocolException;
/** /**
@ -39,6 +41,7 @@ import org.apache.http.ProtocolException;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class NonRepeatableRequestException extends ProtocolException { public class NonRepeatableRequestException extends ProtocolException {
private static final long serialVersionUID = 82685265288806048L; private static final long serialVersionUID = 82685265288806048L;

View File

@ -30,6 +30,8 @@
package org.apache.http.client; package org.apache.http.client;
import net.jcip.annotations.Immutable;
import org.apache.http.ProtocolException; import org.apache.http.ProtocolException;
/** /**
@ -38,6 +40,7 @@ import org.apache.http.ProtocolException;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RedirectException extends ProtocolException { public class RedirectException extends ProtocolException {
private static final long serialVersionUID = 4418824536372559326L; private static final long serialVersionUID = 4418824536372559326L;

View File

@ -31,10 +31,13 @@
package org.apache.http.client.params; package org.apache.http.client.params;
import net.jcip.annotations.Immutable;
/** /**
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public final class AuthPolicy { public final class AuthPolicy {
private AuthPolicy() { private AuthPolicy() {

View File

@ -31,10 +31,13 @@
package org.apache.http.client.params; package org.apache.http.client.params;
import net.jcip.annotations.Immutable;
/** /**
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public final class CookiePolicy { public final class CookiePolicy {
/** /**

View File

@ -30,6 +30,8 @@
package org.apache.http.client.params; package org.apache.http.client.params;
import net.jcip.annotations.Immutable;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
/** /**
@ -40,6 +42,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class HttpClientParams { public class HttpClientParams {
private HttpClientParams() { private HttpClientParams() {

View File

@ -37,6 +37,8 @@ import java.net.URISyntaxException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.http.Header; import org.apache.http.Header;
@ -67,6 +69,7 @@ import org.apache.http.protocol.ExecutionContext;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RequestAddCookies implements HttpRequestInterceptor { public class RequestAddCookies implements HttpRequestInterceptor {
private final Log log = LogFactory.getLog(getClass()); private final Log log = LogFactory.getLog(getClass());

View File

@ -34,6 +34,8 @@ package org.apache.http.client.protocol;
import java.io.IOException; import java.io.IOException;
import java.util.Collection; import java.util.Collection;
import net.jcip.annotations.Immutable;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.HttpException; import org.apache.http.HttpException;
import org.apache.http.HttpRequest; import org.apache.http.HttpRequest;
@ -49,6 +51,7 @@ import org.apache.http.protocol.HttpContext;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RequestDefaultHeaders implements HttpRequestInterceptor { public class RequestDefaultHeaders implements HttpRequestInterceptor {
public RequestDefaultHeaders() { public RequestDefaultHeaders() {

View File

@ -33,6 +33,8 @@ package org.apache.http.client.protocol;
import java.io.IOException; import java.io.IOException;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpException; import org.apache.http.HttpException;
@ -51,6 +53,7 @@ import org.apache.http.protocol.HttpContext;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RequestProxyAuthentication implements HttpRequestInterceptor { public class RequestProxyAuthentication implements HttpRequestInterceptor {
private final Log log = LogFactory.getLog(getClass()); private final Log log = LogFactory.getLog(getClass());

View File

@ -33,6 +33,8 @@ package org.apache.http.client.protocol;
import java.io.IOException; import java.io.IOException;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpException; import org.apache.http.HttpException;
@ -51,6 +53,7 @@ import org.apache.http.protocol.HttpContext;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RequestTargetAuthentication implements HttpRequestInterceptor { public class RequestTargetAuthentication implements HttpRequestInterceptor {
private final Log log = LogFactory.getLog(getClass()); private final Log log = LogFactory.getLog(getClass());

View File

@ -34,6 +34,8 @@ package org.apache.http.client.protocol;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.http.Header; import org.apache.http.Header;
@ -58,6 +60,7 @@ import org.apache.http.protocol.HttpContext;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class ResponseProcessCookies implements HttpResponseInterceptor { public class ResponseProcessCookies implements HttpResponseInterceptor {
private final Log log = LogFactory.getLog(getClass()); private final Log log = LogFactory.getLog(getClass());

View File

@ -32,12 +32,14 @@ package org.apache.http.client.utils;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import net.jcip.annotations.Immutable;
/** /**
* A collection of utilities to workaround limitations of Java clone framework. * A collection of utilities to workaround limitations of Java clone framework.
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class CloneUtils { public class CloneUtils {
public static Object clone(final Object obj) throws CloneNotSupportedException { public static Object clone(final Object obj) throws CloneNotSupportedException {

View File

@ -33,13 +33,16 @@ package org.apache.http.client.utils;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import net.jcip.annotations.Immutable;
/** /**
* Uses the java.net.IDN class through reflection. * Uses the java.net.IDN class through reflection.
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class JdkIdn implements Idn { public class JdkIdn implements Idn {
private Method toUnicode; private final Method toUnicode;
/** /**
* *

View File

@ -32,11 +32,14 @@ package org.apache.http.client.utils;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.jcip.annotations.Immutable;
/** /**
* Implementation from pseudo code in RFC 3492. * Implementation from pseudo code in RFC 3492.
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class Rfc3492Idn implements Idn { public class Rfc3492Idn implements Idn {
private static final int base = 36; private static final int base = 36;
private static final int tmin = 1; private static final int tmin = 1;

View File

@ -33,6 +33,8 @@ package org.apache.http.client.utils;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
/** /**
@ -41,6 +43,7 @@ import org.apache.http.HttpHost;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class URIUtils { public class URIUtils {
/** /**

View File

@ -39,6 +39,9 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Scanner; import java.util.Scanner;
import net.jcip.annotations.Immutable;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair; import org.apache.http.NameValuePair;
@ -51,6 +54,7 @@ import org.apache.http.util.EntityUtils;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class URLEncodedUtils { public class URLEncodedUtils {
public static final String CONTENT_TYPE = "application/x-www-form-urlencoded"; public static final String CONTENT_TYPE = "application/x-www-form-urlencoded";

View File

@ -33,6 +33,8 @@ package org.apache.http.conn;
import java.io.InterruptedIOException; import java.io.InterruptedIOException;
import net.jcip.annotations.Immutable;
/** /**
* A timeout while connecting to an HTTP server or waiting for an * A timeout while connecting to an HTTP server or waiting for an
* available connection from an HttpConnectionManager. * available connection from an HttpConnectionManager.
@ -40,6 +42,7 @@ import java.io.InterruptedIOException;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class ConnectTimeoutException extends InterruptedIOException { public class ConnectTimeoutException extends InterruptedIOException {
private static final long serialVersionUID = -4816682903149535989L; private static final long serialVersionUID = -4816682903149535989L;

View File

@ -31,6 +31,8 @@
package org.apache.http.conn; package org.apache.http.conn;
import net.jcip.annotations.Immutable;
/** /**
* A timeout while waiting for an available connection * A timeout while waiting for an available connection
* from a connection manager. * from a connection manager.
@ -38,6 +40,7 @@ package org.apache.http.conn;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class ConnectionPoolTimeoutException extends ConnectTimeoutException { public class ConnectionPoolTimeoutException extends ConnectTimeoutException {
private static final long serialVersionUID = -7898874842020245128L; private static final long serialVersionUID = -7898874842020245128L;

View File

@ -32,6 +32,8 @@ package org.apache.http.conn;
import java.net.ConnectException; import java.net.ConnectException;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
/** /**
@ -40,6 +42,7 @@ import org.apache.http.HttpHost;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class HttpHostConnectException extends ConnectException { public class HttpHostConnectException extends ConnectException {
private static final long serialVersionUID = -3194482710275220224L; private static final long serialVersionUID = -3194482710275220224L;

View File

@ -41,6 +41,8 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Arrays; import java.util.Arrays;
import net.jcip.annotations.Immutable;
import org.apache.http.conn.scheme.SocketFactory; import org.apache.http.conn.scheme.SocketFactory;
import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
@ -54,6 +56,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public final class MultihomePlainSocketFactory implements SocketFactory { public final class MultihomePlainSocketFactory implements SocketFactory {
/** /**

View File

@ -33,6 +33,8 @@ package org.apache.http.conn.routing;
import java.net.InetAddress; import java.net.InetAddress;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
/** /**
@ -47,6 +49,7 @@ import org.apache.http.HttpHost;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public final class HttpRoute implements RouteInfo, Cloneable { public final class HttpRoute implements RouteInfo, Cloneable {
private static final HttpHost[] EMPTY_HTTP_HOST_ARRAY = new HttpHost[]{}; private static final HttpHost[] EMPTY_HTTP_HOST_ARRAY = new HttpHost[]{};

View File

@ -37,6 +37,8 @@ import java.net.InetSocketAddress;
import java.net.Socket; import java.net.Socket;
import java.net.SocketTimeoutException; import java.net.SocketTimeoutException;
import net.jcip.annotations.Immutable;
import org.apache.http.conn.ConnectTimeoutException; import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
@ -47,6 +49,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public final class PlainSocketFactory implements SocketFactory { public final class PlainSocketFactory implements SocketFactory {
/** /**

View File

@ -32,6 +32,8 @@ package org.apache.http.conn.scheme;
import java.util.Locale; import java.util.Locale;
import net.jcip.annotations.Immutable;
import org.apache.http.util.LangUtils; import org.apache.http.util.LangUtils;
/** /**
@ -52,6 +54,7 @@ import org.apache.http.util.LangUtils;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public final class Scheme { public final class Scheme {
/** The name of this scheme, in lowercase. (e.g. http, https) */ /** The name of this scheme, in lowercase. (e.g. http, https) */
@ -69,6 +72,11 @@ public final class Scheme {
/** A string representation, for {@link #toString toString}. */ /** A string representation, for {@link #toString toString}. */
private String stringRep; private String stringRep;
/*
* This is used to cache the result of the toString() method
* Since the method always generates the same value, there's no
* need to synchronize.
*/
/** /**

View File

@ -35,6 +35,9 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
/** /**
@ -48,9 +51,11 @@ import org.apache.http.HttpHost;
* *
* @since 4.0 * @since 4.0
*/ */
@ThreadSafe
public final class SchemeRegistry { public final class SchemeRegistry {
/** The available schemes in this registry. */ /** The available schemes in this registry. */
@GuardedBy("this")
private final Map<String,Scheme> registeredSchemes; private final Map<String,Scheme> registeredSchemes;

View File

@ -31,6 +31,8 @@
package org.apache.http.conn.ssl; package org.apache.http.conn.ssl;
import net.jcip.annotations.Immutable;
import org.apache.http.conn.util.InetAddressUtils; import org.apache.http.conn.util.InetAddressUtils;
import java.io.IOException; import java.io.IOException;
@ -59,6 +61,7 @@ import javax.net.ssl.SSLSocket;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public abstract class AbstractVerifier implements X509HostnameVerifier { public abstract class AbstractVerifier implements X509HostnameVerifier {
/** /**

View File

@ -31,6 +31,8 @@
package org.apache.http.conn.ssl; package org.apache.http.conn.ssl;
import net.jcip.annotations.Immutable;
/** /**
* The ALLOW_ALL HostnameVerifier essentially turns hostname verification * The ALLOW_ALL HostnameVerifier essentially turns hostname verification
* off. This implementation is a no-op, and never throws the SSLException. * off. This implementation is a no-op, and never throws the SSLException.
@ -38,6 +40,7 @@ package org.apache.http.conn.ssl;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class AllowAllHostnameVerifier extends AbstractVerifier { public class AllowAllHostnameVerifier extends AbstractVerifier {
public final void verify( public final void verify(

View File

@ -33,6 +33,8 @@ package org.apache.http.conn.ssl;
import javax.net.ssl.SSLException; import javax.net.ssl.SSLException;
import net.jcip.annotations.Immutable;
/** /**
* The HostnameVerifier that works the same way as Curl and Firefox. * The HostnameVerifier that works the same way as Curl and Firefox.
* <p/> * <p/>
@ -46,6 +48,7 @@ import javax.net.ssl.SSLException;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BrowserCompatHostnameVerifier extends AbstractVerifier { public class BrowserCompatHostnameVerifier extends AbstractVerifier {
public final void verify( public final void verify(

View File

@ -33,6 +33,8 @@ package org.apache.http.conn.ssl;
import javax.net.ssl.SSLException; import javax.net.ssl.SSLException;
import net.jcip.annotations.Immutable;
/** /**
* The Strict HostnameVerifier works the same way as Sun Java 1.4, Sun * The Strict HostnameVerifier works the same way as Sun Java 1.4, Sun
* Java 5, Sun Java 6-rc. It's also pretty close to IE6. This * Java 5, Sun Java 6-rc. It's also pretty close to IE6. This
@ -53,6 +55,7 @@ import javax.net.ssl.SSLException;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class StrictHostnameVerifier extends AbstractVerifier { public class StrictHostnameVerifier extends AbstractVerifier {
public final void verify( public final void verify(

View File

@ -33,11 +33,14 @@ package org.apache.http.conn.util;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import net.jcip.annotations.Immutable;
/** /**
* A collection of utilities relating to InetAddresses. * A collection of utilities relating to InetAddresses.
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class InetAddressUtils { public class InetAddressUtils {
private InetAddressUtils() { private InetAddressUtils() {

View File

@ -34,6 +34,8 @@ package org.apache.http.cookie;
import java.io.Serializable; import java.io.Serializable;
import java.util.Comparator; import java.util.Comparator;
import net.jcip.annotations.Immutable;
/** /**
* This cookie comparator can be used to compare identity of cookies. * This cookie comparator can be used to compare identity of cookies.
* *
@ -45,6 +47,7 @@ import java.util.Comparator;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class CookieIdentityComparator implements Serializable, Comparator<Cookie> { public class CookieIdentityComparator implements Serializable, Comparator<Cookie> {
private static final long serialVersionUID = 4466565437490631532L; private static final long serialVersionUID = 4466565437490631532L;

View File

@ -32,6 +32,8 @@ package org.apache.http.cookie;
import java.util.Locale; import java.util.Locale;
import net.jcip.annotations.Immutable;
/** /**
* CookieOrigin class incapsulates details of an origin server that * CookieOrigin class incapsulates details of an origin server that
* are relevant when parsing, validating or matching HTTP cookies. * are relevant when parsing, validating or matching HTTP cookies.
@ -39,6 +41,7 @@ import java.util.Locale;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public final class CookieOrigin { public final class CookieOrigin {
private final String host; private final String host;

View File

@ -34,6 +34,8 @@ package org.apache.http.cookie;
import java.io.Serializable; import java.io.Serializable;
import java.util.Comparator; import java.util.Comparator;
import net.jcip.annotations.Immutable;
/** /**
* This cookie comparator ensures that multiple cookies satisfying * This cookie comparator ensures that multiple cookies satisfying
* a common criteria are ordered in the <tt>Cookie</tt> header such * a common criteria are ordered in the <tt>Cookie</tt> header such
@ -49,6 +51,7 @@ import java.util.Comparator;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class CookiePathComparator implements Serializable, Comparator<Cookie> { public class CookiePathComparator implements Serializable, Comparator<Cookie> {
private static final long serialVersionUID = 7523645369616405818L; private static final long serialVersionUID = 7523645369616405818L;

View File

@ -37,6 +37,9 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
/** /**
@ -47,8 +50,10 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@ThreadSafe
public final class CookieSpecRegistry { public final class CookieSpecRegistry {
@GuardedBy("this")
private final Map<String,CookieSpecFactory> registeredSpecs; private final Map<String,CookieSpecFactory> registeredSpecs;
public CookieSpecRegistry() { public CookieSpecRegistry() {

View File

@ -31,6 +31,8 @@
package org.apache.http.cookie; package org.apache.http.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.ProtocolException; import org.apache.http.ProtocolException;
/** /**
@ -40,6 +42,7 @@ import org.apache.http.ProtocolException;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class MalformedCookieException extends ProtocolException { public class MalformedCookieException extends ProtocolException {
private static final long serialVersionUID = -6695462944287282185L; private static final long serialVersionUID = -6695462944287282185L;

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.auth; package org.apache.http.impl.auth;
import net.jcip.annotations.Immutable;
import org.apache.http.auth.AuthScheme; import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthSchemeFactory; import org.apache.http.auth.AuthSchemeFactory;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
@ -40,6 +42,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BasicSchemeFactory implements AuthSchemeFactory { public class BasicSchemeFactory implements AuthSchemeFactory {
public AuthScheme newInstance(final HttpParams params) { public AuthScheme newInstance(final HttpParams params) {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.auth; package org.apache.http.impl.auth;
import net.jcip.annotations.Immutable;
import org.apache.http.auth.AuthScheme; import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthSchemeFactory; import org.apache.http.auth.AuthSchemeFactory;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
@ -40,6 +42,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class DigestSchemeFactory implements AuthSchemeFactory { public class DigestSchemeFactory implements AuthSchemeFactory {
public AuthScheme newInstance(final HttpParams params) { public AuthScheme newInstance(final HttpParams params) {

View File

@ -30,6 +30,8 @@
package org.apache.http.impl.auth; package org.apache.http.impl.auth;
import net.jcip.annotations.Immutable;
import org.apache.http.auth.AuthenticationException; import org.apache.http.auth.AuthenticationException;
/** /**
@ -38,6 +40,7 @@ import org.apache.http.auth.AuthenticationException;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class NTLMEngineException extends AuthenticationException { public class NTLMEngineException extends AuthenticationException {
private static final long serialVersionUID = 6027981323731768824L; private static final long serialVersionUID = 6027981323731768824L;

View File

@ -30,6 +30,8 @@
package org.apache.http.impl.auth; package org.apache.http.impl.auth;
import net.jcip.annotations.Immutable;
/** /**
* Authentication credentials required to respond to a authentication * Authentication credentials required to respond to a authentication
* challenge are invalid * challenge are invalid
@ -37,6 +39,7 @@ package org.apache.http.impl.auth;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class UnsupportedDigestAlgorithmException extends RuntimeException { public class UnsupportedDigestAlgorithmException extends RuntimeException {
private static final long serialVersionUID = 319558534317118022L; private static final long serialVersionUID = 319558534317118022L;

View File

@ -37,6 +37,9 @@ import java.util.Date;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import org.apache.http.client.CookieStore; import org.apache.http.client.CookieStore;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieIdentityComparator; import org.apache.http.cookie.CookieIdentityComparator;
@ -47,10 +50,13 @@ import org.apache.http.cookie.CookieIdentityComparator;
* *
* @since 4.0 * @since 4.0
*/ */
@ThreadSafe
public class BasicCookieStore implements CookieStore { public class BasicCookieStore implements CookieStore {
@GuardedBy("this")
private final ArrayList<Cookie> cookies; private final ArrayList<Cookie> cookies;
@GuardedBy("this")
private final Comparator<Cookie> cookieComparator; private final Comparator<Cookie> cookieComparator;
// -------------------------------------------------------- Class Variables // -------------------------------------------------------- Class Variables

View File

@ -32,6 +32,9 @@ package org.apache.http.impl.client;
import java.util.HashMap; import java.util.HashMap;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import org.apache.http.auth.AuthScope; import org.apache.http.auth.AuthScope;
import org.apache.http.auth.Credentials; import org.apache.http.auth.Credentials;
import org.apache.http.client.CredentialsProvider; import org.apache.http.client.CredentialsProvider;
@ -42,8 +45,10 @@ import org.apache.http.client.CredentialsProvider;
* *
* @since 4.0 * @since 4.0
*/ */
@ThreadSafe
public class BasicCredentialsProvider implements CredentialsProvider { public class BasicCredentialsProvider implements CredentialsProvider {
@GuardedBy("this")
private final HashMap<AuthScope, Credentials> credMap; private final HashMap<AuthScope, Credentials> credMap;
/** /**

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.client;
import java.io.IOException; import java.io.IOException;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.StatusLine; import org.apache.http.StatusLine;
@ -55,6 +57,7 @@ import org.apache.http.util.EntityUtils;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BasicResponseHandler implements ResponseHandler<String> { public class BasicResponseHandler implements ResponseHandler<String> {
/** /**

View File

@ -30,6 +30,8 @@
*/ */
package org.apache.http.impl.client; package org.apache.http.impl.client;
import net.jcip.annotations.Immutable;
import org.apache.http.HeaderElement; import org.apache.http.HeaderElement;
import org.apache.http.HeaderElementIterator; import org.apache.http.HeaderElementIterator;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
@ -50,6 +52,7 @@ import org.apache.http.protocol.HttpContext;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class DefaultConnectionKeepAliveStrategy implements ConnectionKeepAliveStrategy { public class DefaultConnectionKeepAliveStrategy implements ConnectionKeepAliveStrategy {
public long getKeepAliveDuration(HttpResponse response, HttpContext context) { public long getKeepAliveDuration(HttpResponse response, HttpContext context) {

View File

@ -38,6 +38,8 @@ import java.net.UnknownHostException;
import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.SSLHandshakeException;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpEntityEnclosingRequest; import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.HttpRequest; import org.apache.http.HttpRequest;
import org.apache.http.NoHttpResponseException; import org.apache.http.NoHttpResponseException;
@ -51,6 +53,7 @@ import org.apache.http.protocol.ExecutionContext;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler { public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler {
/** the number of times a method will be retried */ /** the number of times a method will be retried */

View File

@ -34,6 +34,8 @@ package org.apache.http.impl.client;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.http.Header; import org.apache.http.Header;
@ -61,6 +63,7 @@ import org.apache.http.protocol.ExecutionContext;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class DefaultRedirectHandler implements RedirectHandler { public class DefaultRedirectHandler implements RedirectHandler {
private final Log log = LogFactory.getLog(getClass()); private final Log log = LogFactory.getLog(getClass());

View File

@ -34,6 +34,8 @@ import java.security.Principal;
import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSession;
import net.jcip.annotations.Immutable;
import org.apache.http.auth.AuthScheme; import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthState; import org.apache.http.auth.AuthState;
import org.apache.http.auth.Credentials; import org.apache.http.auth.Credentials;
@ -47,6 +49,7 @@ import org.apache.http.protocol.HttpContext;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class DefaultUserTokenHandler implements UserTokenHandler { public class DefaultUserTokenHandler implements UserTokenHandler {
public Object getUserToken(final HttpContext context) { public Object getUserToken(final HttpContext context) {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.client; package org.apache.http.impl.client;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpException; import org.apache.http.HttpException;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
@ -38,6 +40,7 @@ import org.apache.http.HttpResponse;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class TunnelRefusedException extends HttpException { public class TunnelRefusedException extends HttpException {
private static final long serialVersionUID = -8646722842745617323L; private static final long serialVersionUID = -8646722842745617323L;

View File

@ -33,6 +33,9 @@ package org.apache.http.impl.conn;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
/** /**
@ -41,6 +44,7 @@ import org.apache.commons.logging.Log;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class Wire { public class Wire {
private final Log log; private final Log log;

View File

@ -30,6 +30,8 @@
*/ */
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.CookieOrigin;
@ -39,6 +41,7 @@ import org.apache.http.cookie.MalformedCookieException;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public abstract class AbstractCookieAttributeHandler implements CookieAttributeHandler { public abstract class AbstractCookieAttributeHandler implements CookieAttributeHandler {
public void validate(final Cookie cookie, final CookieOrigin origin) public void validate(final Cookie cookie, final CookieOrigin origin)

View File

@ -30,6 +30,8 @@
*/ */
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.MalformedCookieException; import org.apache.http.cookie.MalformedCookieException;
import org.apache.http.cookie.SetCookie; import org.apache.http.cookie.SetCookie;
@ -37,6 +39,7 @@ import org.apache.http.cookie.SetCookie;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BasicCommentHandler extends AbstractCookieAttributeHandler { public class BasicCommentHandler extends AbstractCookieAttributeHandler {
public BasicCommentHandler() { public BasicCommentHandler() {

View File

@ -30,6 +30,8 @@
*/ */
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.CookieOrigin;
@ -40,6 +42,7 @@ import org.apache.http.cookie.SetCookie;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BasicDomainHandler implements CookieAttributeHandler { public class BasicDomainHandler implements CookieAttributeHandler {
public BasicDomainHandler() { public BasicDomainHandler() {

View File

@ -30,6 +30,8 @@
*/ */
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.MalformedCookieException; import org.apache.http.cookie.MalformedCookieException;
import org.apache.http.cookie.SetCookie; import org.apache.http.cookie.SetCookie;
@ -38,6 +40,7 @@ import org.apache.http.cookie.SetCookie;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BasicExpiresHandler extends AbstractCookieAttributeHandler { public class BasicExpiresHandler extends AbstractCookieAttributeHandler {
/** Valid date patterns */ /** Valid date patterns */

View File

@ -32,6 +32,8 @@ package org.apache.http.impl.cookie;
import java.util.Date; import java.util.Date;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.MalformedCookieException; import org.apache.http.cookie.MalformedCookieException;
import org.apache.http.cookie.SetCookie; import org.apache.http.cookie.SetCookie;
@ -39,6 +41,7 @@ import org.apache.http.cookie.SetCookie;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BasicMaxAgeHandler extends AbstractCookieAttributeHandler { public class BasicMaxAgeHandler extends AbstractCookieAttributeHandler {
public BasicMaxAgeHandler() { public BasicMaxAgeHandler() {

View File

@ -30,6 +30,8 @@
*/ */
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.CookieOrigin;
@ -40,6 +42,7 @@ import org.apache.http.cookie.SetCookie;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BasicPathHandler implements CookieAttributeHandler { public class BasicPathHandler implements CookieAttributeHandler {
public BasicPathHandler() { public BasicPathHandler() {

View File

@ -30,6 +30,8 @@
*/ */
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.MalformedCookieException; import org.apache.http.cookie.MalformedCookieException;
@ -39,6 +41,7 @@ import org.apache.http.cookie.SetCookie;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BasicSecureHandler extends AbstractCookieAttributeHandler { public class BasicSecureHandler extends AbstractCookieAttributeHandler {
public BasicSecureHandler() { public BasicSecureHandler() {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec; import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory; import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames; import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BestMatchSpecFactory implements CookieSpecFactory { public class BestMatchSpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) { public CookieSpec newInstance(final HttpParams params) {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec; import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory; import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames; import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class BrowserCompatSpecFactory implements CookieSpecFactory { public class BrowserCompatSpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) { public CookieSpec newInstance(final HttpParams params) {

View File

@ -31,6 +31,7 @@
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
/** /**
* An exception to indicate an error parsing a date string. * An exception to indicate an error parsing a date string.
@ -40,6 +41,7 @@ package org.apache.http.impl.cookie;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class DateParseException extends Exception { public class DateParseException extends Exception {
private static final long serialVersionUID = 4417696455000643370L; private static final long serialVersionUID = 4417696455000643370L;

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.cookie;
import java.util.Locale; import java.util.Locale;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.MalformedCookieException; import org.apache.http.cookie.MalformedCookieException;
@ -41,6 +43,7 @@ import org.apache.http.cookie.MalformedCookieException;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class NetscapeDomainHandler extends BasicDomainHandler { public class NetscapeDomainHandler extends BasicDomainHandler {
public NetscapeDomainHandler() { public NetscapeDomainHandler() {

View File

@ -34,6 +34,8 @@ package org.apache.http.impl.cookie;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.jcip.annotations.Immutable;
import org.apache.http.HeaderElement; import org.apache.http.HeaderElement;
import org.apache.http.NameValuePair; import org.apache.http.NameValuePair;
import org.apache.http.ParseException; import org.apache.http.ParseException;
@ -46,6 +48,7 @@ import org.apache.http.util.CharArrayBuffer;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class NetscapeDraftHeaderParser { public class NetscapeDraftHeaderParser {
public final static NetscapeDraftHeaderParser DEFAULT = new NetscapeDraftHeaderParser(); public final static NetscapeDraftHeaderParser DEFAULT = new NetscapeDraftHeaderParser();

View File

@ -34,6 +34,8 @@ package org.apache.http.impl.cookie;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.jcip.annotations.Immutable;
import org.apache.http.FormattedHeader; import org.apache.http.FormattedHeader;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.HeaderElement; import org.apache.http.HeaderElement;
@ -52,6 +54,7 @@ import org.apache.http.util.CharArrayBuffer;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class NetscapeDraftSpec extends CookieSpecBase { public class NetscapeDraftSpec extends CookieSpecBase {
protected static final String EXPIRES_PATTERN = "EEE, dd-MMM-yyyy HH:mm:ss z"; protected static final String EXPIRES_PATTERN = "EEE, dd-MMM-yyyy HH:mm:ss z";

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec; import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory; import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames; import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class NetscapeDraftSpecFactory implements CookieSpecFactory { public class NetscapeDraftSpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) { public CookieSpec newInstance(final HttpParams params) {

View File

@ -37,15 +37,18 @@ import java.io.Reader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import net.jcip.annotations.Immutable;
/** /**
* Parses the list from <a href="http://publicsuffix.org/">publicsuffix.org</a> * Parses the list from <a href="http://publicsuffix.org/">publicsuffix.org</a>
* and configures a PublicSuffixFilter. * and configures a PublicSuffixFilter.
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class PublicSuffixListParser { public class PublicSuffixListParser {
private static final int MAX_LINE_LEN = 256; private static final int MAX_LINE_LEN = 256;
private PublicSuffixFilter filter; private final PublicSuffixFilter filter;
PublicSuffixListParser(PublicSuffixFilter filter) { PublicSuffixListParser(PublicSuffixFilter filter) {
this.filter = filter; this.filter = filter;

View File

@ -32,6 +32,8 @@ package org.apache.http.impl.cookie;
import java.util.Locale; import java.util.Locale;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.CookieOrigin;
@ -42,6 +44,7 @@ import org.apache.http.cookie.SetCookie;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RFC2109DomainHandler implements CookieAttributeHandler { public class RFC2109DomainHandler implements CookieAttributeHandler {
public RFC2109DomainHandler() { public RFC2109DomainHandler() {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec; import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory; import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames; import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RFC2109SpecFactory implements CookieSpecFactory { public class RFC2109SpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) { public CookieSpec newInstance(final HttpParams params) {

View File

@ -30,6 +30,8 @@
*/ */
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.MalformedCookieException; import org.apache.http.cookie.MalformedCookieException;
@ -39,6 +41,7 @@ import org.apache.http.cookie.SetCookie;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RFC2109VersionHandler extends AbstractCookieAttributeHandler { public class RFC2109VersionHandler extends AbstractCookieAttributeHandler {
public RFC2109VersionHandler() { public RFC2109VersionHandler() {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.CookieOrigin;
@ -43,6 +45,7 @@ import org.apache.http.cookie.SetCookie2;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RFC2965CommentUrlAttributeHandler implements CookieAttributeHandler { public class RFC2965CommentUrlAttributeHandler implements CookieAttributeHandler {
public RFC2965CommentUrlAttributeHandler() { public RFC2965CommentUrlAttributeHandler() {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin; import org.apache.http.cookie.CookieOrigin;
@ -43,6 +45,7 @@ import org.apache.http.cookie.SetCookie2;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RFC2965DiscardAttributeHandler implements CookieAttributeHandler { public class RFC2965DiscardAttributeHandler implements CookieAttributeHandler {
public RFC2965DiscardAttributeHandler() { public RFC2965DiscardAttributeHandler() {

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.cookie;
import java.util.Locale; import java.util.Locale;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.ClientCookie; import org.apache.http.cookie.ClientCookie;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieAttributeHandler;
@ -46,6 +48,7 @@ import org.apache.http.cookie.SetCookie;
* *
* @since 3.1 * @since 3.1
*/ */
@Immutable
public class RFC2965DomainAttributeHandler implements CookieAttributeHandler { public class RFC2965DomainAttributeHandler implements CookieAttributeHandler {
public RFC2965DomainAttributeHandler() { public RFC2965DomainAttributeHandler() {

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.cookie;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.ClientCookie; import org.apache.http.cookie.ClientCookie;
import org.apache.http.cookie.Cookie; import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieAttributeHandler;
@ -46,6 +48,7 @@ import org.apache.http.cookie.SetCookie2;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RFC2965PortAttributeHandler implements CookieAttributeHandler { public class RFC2965PortAttributeHandler implements CookieAttributeHandler {
public RFC2965PortAttributeHandler() { public RFC2965PortAttributeHandler() {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie; package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec; import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory; import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames; import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@Immutable
public class RFC2965SpecFactory implements CookieSpecFactory { public class RFC2965SpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) { public CookieSpec newInstance(final HttpParams params) {