Make AbstractAuthenticationHandler immutable by changing the List to unmodifiable

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@755783 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-03-18 23:38:11 +00:00
parent 6c01316e2c
commit 5b44cc0938
3 changed files with 13 additions and 2 deletions

View File

@ -32,11 +32,14 @@
package org.apache.http.impl.client;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.FormattedHeader;
@ -56,15 +59,17 @@ import org.apache.http.util.CharArrayBuffer;
*
* @since 4.0
*/
@Immutable
public abstract class AbstractAuthenticationHandler implements AuthenticationHandler {
private final Log log = LogFactory.getLog(getClass());
private static final List<String> DEFAULT_SCHEME_PRIORITY = Arrays.asList(new String[] {
private static final List<String> DEFAULT_SCHEME_PRIORITY =
Collections.unmodifiableList(Arrays.asList(new String[] {
"ntlm",
"digest",
"basic"
});
}));
public AbstractAuthenticationHandler() {
super();

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.client;
import java.util.Map;
import net.jcip.annotations.Immutable;
import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
@ -44,6 +46,7 @@ import org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
public class DefaultProxyAuthenticationHandler extends AbstractAuthenticationHandler {
public DefaultProxyAuthenticationHandler() {

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.client;
import java.util.Map;
import net.jcip.annotations.Immutable;
import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
@ -44,6 +46,7 @@ import org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
public class DefaultTargetAuthenticationHandler extends AbstractAuthenticationHandler {
public DefaultTargetAuthenticationHandler() {