Add thread-safety annotations
Copy string array in constructor to avoid external changes git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@797269 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
49b68a54d8
commit
eee617209b
|
@ -29,6 +29,8 @@ package org.apache.http.impl.cookie;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.jcip.annotations.NotThreadSafe;
|
||||||
|
|
||||||
import org.apache.http.Header;
|
import org.apache.http.Header;
|
||||||
import org.apache.http.HeaderElement;
|
import org.apache.http.HeaderElement;
|
||||||
import org.apache.http.cookie.Cookie;
|
import org.apache.http.cookie.Cookie;
|
||||||
|
@ -44,19 +46,21 @@ import org.apache.http.cookie.SetCookie2;
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
@NotThreadSafe // CookieSpec fields are @NotThreadSafe
|
||||||
public class BestMatchSpec implements CookieSpec {
|
public class BestMatchSpec implements CookieSpec {
|
||||||
|
|
||||||
private final String[] datepatterns;
|
private final String[] datepatterns;
|
||||||
private final boolean oneHeader;
|
private final boolean oneHeader;
|
||||||
|
|
||||||
private RFC2965Spec strict;
|
// Cached values of CookieSpec instances
|
||||||
private RFC2109Spec obsoleteStrict;
|
private RFC2965Spec strict; // @NotThreadSafe
|
||||||
private BrowserCompatSpec compat;
|
private RFC2109Spec obsoleteStrict; // @NotThreadSafe
|
||||||
private NetscapeDraftSpec netscape;
|
private BrowserCompatSpec compat; // @NotThreadSafe
|
||||||
|
private NetscapeDraftSpec netscape; // @NotThreadSafe
|
||||||
|
|
||||||
public BestMatchSpec(final String[] datepatterns, boolean oneHeader) {
|
public BestMatchSpec(final String[] datepatterns, boolean oneHeader) {
|
||||||
super();
|
super();
|
||||||
this.datepatterns = datepatterns;
|
this.datepatterns = datepatterns.clone();
|
||||||
this.oneHeader = oneHeader;
|
this.oneHeader = oneHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue