hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r653067 - in /httpcomponents/oac.hc3x/trunk/src: contrib/org/apache/commons/httpclient/contrib/proxy/ contrib/org/apache/commons/httpclient/contrib/ssl/ java/org/apache/commons/httpclient/ java/org/apache/commons/httpclient/auth/ java/org/a...
Date Sat, 03 May 2008 12:42:40 GMT
Author: sebb
Date: Sat May  3 05:42:39 2008
New Revision: 653067

URL: http://svn.apache.org/viewvc?rev=653067&view=rev
Log:
Fixup LowerCase/UpperCase in case there's ever a further release

Modified:
    httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java
    httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/Cookie.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HeaderGroup.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/StatusLine.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/URI.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeParser.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeProcessor.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthPolicy.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/NTLM.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/RFC2617Scheme.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/NetscapeDraftSpec.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/methods/OptionsMethod.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
    httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/protocol/Protocol.java
    httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestExceptions.java
    httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestHeaderOps.java

Modified: httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/proxy/PluginProxyUtil.java
Sat May  3 05:42:39 2008
@@ -32,6 +32,7 @@
 import java.lang.reflect.Array;
 import java.lang.reflect.Method;
 import java.net.URL;
+import java.util.Locale;
 import java.util.Properties;
 
 import org.apache.commons.httpclient.ProxyHost;
@@ -286,7 +287,7 @@
             }
             boolean useProxy = (proxyList != null);
             if (useProxy) {
-                proxyList = proxyList.toUpperCase();
+                proxyList = proxyList.toUpperCase(Locale.ENGLISH);
                 //  Using HTTP proxy as proxy for HTTP proxy tunnelled SSL 
                 //  socket (should be listed FIRST)....
                 //  1/14/03 1.3.1_06 appears to omit HTTP portion of 

Modified: httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/HttpHostFactory.java
Sat May  3 05:42:39 2008
@@ -1,5 +1,7 @@
 package org.apache.commons.httpclient.contrib.ssl;
 
+import java.util.Locale;
+
 import org.apache.commons.httpclient.HostConfiguration;
 import org.apache.commons.httpclient.HttpHost;
 import org.apache.commons.httpclient.HttpsURL;
@@ -47,7 +49,7 @@
                 return oldProtocol; // Retain it.
             }
         }
-        Protocol newProtocol = (scheme != null && scheme.toLowerCase().endsWith("s"))
? httpsProtocol
+        Protocol newProtocol = (scheme != null && scheme.toLowerCase(Locale.ENGLISH).endsWith("s"))
? httpsProtocol
                 : httpProtocol;
         if (newProtocol == null) {
             newProtocol = Protocol.getProtocol(scheme);

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/Cookie.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/Cookie.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/Cookie.java (original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/Cookie.java Sat May
 3 05:42:39 2008
@@ -33,6 +33,7 @@
 import java.io.Serializable;
 import java.util.Comparator;
 import java.util.Date;
+import java.util.Locale;
 
 import org.apache.commons.httpclient.cookie.CookiePolicy;
 import org.apache.commons.httpclient.cookie.CookieSpec;
@@ -234,7 +235,7 @@
             if (ndx != -1) {
               domain = domain.substring(0, ndx);
             }
-            cookieDomain = domain.toLowerCase();
+            cookieDomain = domain.toLowerCase(Locale.ENGLISH);
         }
     }
 

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HeaderGroup.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HeaderGroup.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HeaderGroup.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HeaderGroup.java
Sat May  3 05:42:39 2008
@@ -33,6 +33,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 
 /**
  * A class for combining a set of headers.  This class allows for multiple
@@ -122,7 +123,7 @@
                 valueBuffer.append(headers[i].getValue());
             }
             
-            return new Header(name.toLowerCase(), valueBuffer.toString());
+            return new Header(name.toLowerCase(Locale.ENGLISH), valueBuffer.toString());
         }
     }
     

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/HttpMethodBase.java
Sat May  3 05:42:39 2008
@@ -36,6 +36,7 @@
 import java.io.InputStream;
 import java.io.InterruptedIOException;
 import java.util.Collection;
+import java.util.Locale;
 
 import org.apache.commons.httpclient.auth.AuthState;
 import org.apache.commons.httpclient.cookie.CookiePolicy;
@@ -1503,7 +1504,7 @@
         // Absolute or relative URL?
         if (!connection.isTransparent()) {
             Protocol protocol = connection.getProtocol();
-            buf.append(protocol.getScheme().toLowerCase());
+            buf.append(protocol.getScheme().toLowerCase(Locale.ENGLISH));
             buf.append("://");
             buf.append(connection.getHost());
             if ((connection.getPort() != -1) 

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/StatusLine.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/StatusLine.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/StatusLine.java (original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/StatusLine.java Sat
May  3 05:42:39 2008
@@ -30,6 +30,8 @@
 
 package org.apache.commons.httpclient;
 
+import java.util.Locale;
+
 /**
  * Represents a Status-Line as returned from a HTTP server.
  *
@@ -100,7 +102,7 @@
                         "Unable to parse HTTP-Version from the status line: '"
                         + statusLine + "'");
             }
-            this.httpVersion = (statusLine.substring(start, at)).toUpperCase();
+            this.httpVersion = (statusLine.substring(start, at)).toUpperCase(Locale.ENGLISH);
 
             //advance through spaces
             while (statusLine.charAt(at) == ' ') {

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/URI.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/URI.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/URI.java (original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/URI.java Sat May
 3 05:42:39 2008
@@ -264,7 +264,7 @@
         if (scheme == null) {
            throw new URIException(URIException.PARSING, "scheme required");
         }
-        char[] s = scheme.toLowerCase().toCharArray();
+        char[] s = scheme.toLowerCase(Locale.ENGLISH).toCharArray();
         if (validate(s, URI.scheme)) {
             _scheme = s; // is_absoluteURI
         } else {
@@ -1945,7 +1945,7 @@
          * </pre></blockquote><p>
          */
         if (at > 0 && at < length && tmp.charAt(at) == ':') {
-            char[] target = tmp.substring(0, at).toLowerCase().toCharArray();
+            char[] target = tmp.substring(0, at).toLowerCase(Locale.ENGLISH).toCharArray();
             if (validate(target, scheme)) {
                 _scheme = target;
             } else {

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeParser.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeParser.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeParser.java
Sat May  3 05:42:39 2008
@@ -32,6 +32,7 @@
 
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.commons.httpclient.Header;
@@ -74,7 +75,7 @@
         if (s.equals("")) {
             throw new MalformedChallengeException("Invalid challenge: " + challengeStr);
         }
-        return s.toLowerCase();
+        return s.toLowerCase(Locale.ENGLISH);
     }
 
     /** 
@@ -103,7 +104,7 @@
             challengeStr.substring(idx + 1, challengeStr.length()), ',');
         for (int i = 0; i < params.size(); i++) {
             NameValuePair param = (NameValuePair) params.get(i);
-            map.put(param.getName().toLowerCase(), param.getValue());
+            map.put(param.getName().toLowerCase(Locale.ENGLISH), param.getValue());
         }
         return map;
     }

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeProcessor.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeProcessor.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeProcessor.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthChallengeProcessor.java
Sat May  3 05:42:39 2008
@@ -32,6 +32,7 @@
 
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.commons.httpclient.params.HttpParams;
@@ -95,7 +96,7 @@
         Iterator item = authPrefs.iterator();
         while (item.hasNext()) {
             String id = (String) item.next();
-            challenge = (String) challenges.get(id.toLowerCase()); 
+            challenge = (String) challenges.get(id.toLowerCase(Locale.ENGLISH)); 
             if (challenge != null) {
                 if (LOG.isInfoEnabled()) {
                     LOG.info(id + " authentication scheme selected");
@@ -154,7 +155,7 @@
         if (LOG.isDebugEnabled()) {
             LOG.debug("Using authentication scheme: " + id);
         }
-        String challenge = (String) challenges.get(id.toLowerCase());
+        String challenge = (String) challenges.get(id.toLowerCase(Locale.ENGLISH));
         if (challenge == null) {
             throw new AuthenticationException(id + 
                 " authorization challenge expected, but not found");

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthPolicy.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthPolicy.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthPolicy.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthPolicy.java
Sat May  3 05:42:39 2008
@@ -33,6 +33,7 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -129,8 +130,8 @@
         if (clazz == null) {
             throw new IllegalArgumentException("Authentication scheme class may not be null");
         }
-        SCHEMES.put(id.toLowerCase(), clazz);
-        SCHEME_LIST.add(id.toLowerCase());
+        SCHEMES.put(id.toLowerCase(Locale.ENGLISH), clazz);
+        SCHEME_LIST.add(id.toLowerCase(Locale.ENGLISH));
     }
 
     /**
@@ -143,8 +144,8 @@
          if (id == null) {
              throw new IllegalArgumentException("Id may not be null");
          }
-        SCHEMES.remove(id.toLowerCase());
-        SCHEME_LIST.remove(id.toLowerCase());
+        SCHEMES.remove(id.toLowerCase(Locale.ENGLISH));
+        SCHEME_LIST.remove(id.toLowerCase(Locale.ENGLISH));
     }
 
     /**
@@ -162,7 +163,7 @@
         if (id == null) {
             throw new IllegalArgumentException("Id may not be null");
         }
-        Class clazz = (Class)SCHEMES.get(id.toLowerCase());
+        Class clazz = (Class)SCHEMES.get(id.toLowerCase(Locale.ENGLISH));
         if (clazz != null) {
             try {
                 return (AuthScheme)clazz.newInstance();

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/AuthScope.java
Sat May  3 05:42:39 2008
@@ -30,6 +30,8 @@
 
 package org.apache.commons.httpclient.auth;
 
+import java.util.Locale;
+
 import org.apache.commons.httpclient.util.LangUtils;
 
 /** 
@@ -106,10 +108,10 @@
     public AuthScope(final String host, int port, 
         final String realm, final String scheme)
     {
-        this.host =   (host == null)   ? ANY_HOST: host.toLowerCase();
+        this.host =   (host == null)   ? ANY_HOST: host.toLowerCase(Locale.ENGLISH);
         this.port =   (port < 0)       ? ANY_PORT: port;
         this.realm =  (realm == null)  ? ANY_REALM: realm;
-        this.scheme = (scheme == null) ? ANY_SCHEME: scheme.toUpperCase();;
+        this.scheme = (scheme == null) ? ANY_SCHEME: scheme.toUpperCase(Locale.ENGLISH);
     }
     
     /** Creates a new credentials scope for the given 
@@ -294,7 +296,7 @@
     public String toString() {
         StringBuffer buffer = new StringBuffer();
         if (this.scheme != null) {
-            buffer.append(this.scheme.toUpperCase());
+            buffer.append(this.scheme.toUpperCase(Locale.ENGLISH));
             buffer.append(' ');
         }
         if (this.realm != null) {

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/NTLM.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/NTLM.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/NTLM.java (original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/NTLM.java Sat
May  3 05:42:39 2008
@@ -32,6 +32,7 @@
 
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
+import java.util.Locale;
 
 import javax.crypto.BadPaddingException;
 import javax.crypto.Cipher;
@@ -230,8 +231,8 @@
      * @return String the message to add to the HTTP request header.
      */
     public String getType1Message(String host, String domain) {
-        host = host.toUpperCase();
-        domain = domain.toUpperCase();
+        host = host.toUpperCase(Locale.ENGLISH);
+        domain = domain.toUpperCase(Locale.ENGLISH);
         byte[] hostBytes = EncodingUtil.getBytes(host, DEFAULT_CHARSET);
         byte[] domainBytes = EncodingUtil.getBytes(domain, DEFAULT_CHARSET);
 
@@ -334,9 +335,9 @@
 
         int ntRespLen = 0;
         int lmRespLen = 24;
-        domain = domain.toUpperCase();
-        host = host.toUpperCase();
-        user = user.toUpperCase();
+        domain = domain.toUpperCase(Locale.ENGLISH);
+        host = host.toUpperCase(Locale.ENGLISH);
+        user = user.toUpperCase(Locale.ENGLISH);
         byte[] domainBytes = EncodingUtil.getBytes(domain, DEFAULT_CHARSET);
         byte[] hostBytes = EncodingUtil.getBytes(host, DEFAULT_CHARSET);
         byte[] userBytes = EncodingUtil.getBytes(user, credentialCharset);
@@ -429,7 +430,7 @@
      */
     private byte[] hashPassword(String password, byte[] nonce)
         throws AuthenticationException {
-        byte[] passw = EncodingUtil.getBytes(password.toUpperCase(), credentialCharset);
+        byte[] passw = EncodingUtil.getBytes(password.toUpperCase(Locale.ENGLISH), credentialCharset);
         byte[] lmPw1 = new byte[7];
         byte[] lmPw2 = new byte[7];
 

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/RFC2617Scheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/RFC2617Scheme.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/RFC2617Scheme.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/auth/RFC2617Scheme.java
Sat May  3 05:42:39 2008
@@ -30,6 +30,7 @@
 
 package org.apache.commons.httpclient.auth;
 
+import java.util.Locale;
 import java.util.Map;
 
 /**
@@ -117,7 +118,7 @@
         if (this.params == null) {
             return null;
         }
-        return (String) this.params.get(name.toLowerCase());
+        return (String) this.params.get(name.toLowerCase(Locale.ENGLISH));
     }
 
     /**

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookiePolicy.java
Sat May  3 05:42:39 2008
@@ -32,6 +32,7 @@
 
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.commons.logging.Log;
@@ -171,7 +172,7 @@
         if (clazz == null) {
             throw new IllegalArgumentException("Cookie spec class may not be null");
         }
-        SPECS.put(id.toLowerCase(), clazz);
+        SPECS.put(id.toLowerCase(Locale.ENGLISH), clazz);
     }
 
     /**
@@ -185,7 +186,7 @@
          if (id == null) {
              throw new IllegalArgumentException("Id may not be null");
          }
-         SPECS.remove(id.toLowerCase());
+         SPECS.remove(id.toLowerCase(Locale.ENGLISH));
     }
 
     /**
@@ -205,7 +206,7 @@
         if (id == null) {
             throw new IllegalArgumentException("Id may not be null");
         }
-        Class clazz = (Class)SPECS.get(id.toLowerCase());
+        Class clazz = (Class)SPECS.get(id.toLowerCase(Locale.ENGLISH));
 
         if (clazz != null) {
             try {

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java
Sat May  3 05:42:39 2008
@@ -34,6 +34,7 @@
 import java.util.Date;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Locale;
 
 import org.apache.commons.httpclient.Cookie;
 import org.apache.commons.httpclient.Header;
@@ -135,7 +136,7 @@
         if (path.trim().equals("")) {
             path = PATH_DELIM;
         }
-        host = host.toLowerCase();
+        host = host.toLowerCase(Locale.ENGLISH);
 
         String defaultPath = path;    
         int lastSlashIndex = defaultPath.lastIndexOf(PATH_DELIM);
@@ -150,7 +151,7 @@
         HeaderElement[] headerElements = null;
 
         boolean isNetscapeCookie = false; 
-        int i1 = header.toLowerCase().indexOf("expires=");
+        int i1 = header.toLowerCase(Locale.ENGLISH).indexOf("expires=");
         if (i1 != -1) {
             i1 += "expires=".length();
             int i2 = header.indexOf(";", i1);
@@ -269,7 +270,7 @@
         if (cookie == null) {
             throw new IllegalArgumentException("Cookie may not be null.");
         }
-        final String paramName = attribute.getName().toLowerCase();
+        final String paramName = attribute.getName().toLowerCase(Locale.ENGLISH);
         String paramValue = attribute.getValue();
 
         if (paramName.equals("path")) {
@@ -386,7 +387,7 @@
         if (path.trim().equals("")) {
             path = PATH_DELIM;
         }
-        host = host.toLowerCase();
+        host = host.toLowerCase(Locale.ENGLISH);
         // check version
         if (cookie.getVersion() < 0) {
             throw new MalformedCookieException ("Illegal version number " 
@@ -474,7 +475,7 @@
         if (path.trim().equals("")) {
             path = PATH_DELIM;
         }
-        host = host.toLowerCase();
+        host = host.toLowerCase(Locale.ENGLISH);
         if (cookie.getDomain() == null) {
             LOG.warn("Invalid cookie state: domain not specified");
             return false;

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/NetscapeDraftSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/NetscapeDraftSpec.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/NetscapeDraftSpec.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/NetscapeDraftSpec.java
Sat May  3 05:42:39 2008
@@ -125,7 +125,7 @@
         if (path.trim().equals("")) {
             path = PATH_DELIM;
         }
-        host = host.toLowerCase();
+        host = host.toLowerCase(Locale.ENGLISH);
 
         String defaultPath = path;    
         int lastSlashIndex = defaultPath.lastIndexOf(PATH_DELIM);
@@ -174,7 +174,7 @@
         if (cookie == null) {
             throw new IllegalArgumentException("Cookie may not be null.");
         }
-        final String paramName = attribute.getName().toLowerCase();
+        final String paramName = attribute.getName().toLowerCase(Locale.ENGLISH);
         final String paramValue = attribute.getValue();
 
         if (paramName.equals("expires")) {
@@ -256,7 +256,7 @@
      * @return True if the specified domain is "special"
      */
     private static boolean isSpecialDomain(final String domain) {
-        final String ucDomain = domain.toUpperCase();
+        final String ucDomain = domain.toUpperCase(Locale.ENGLISH);
         if (ucDomain.endsWith(".COM") 
            || ucDomain.endsWith(".EDU")
            || ucDomain.endsWith(".NET")

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java
Sat May  3 05:42:39 2008
@@ -30,6 +30,8 @@
 
 package org.apache.commons.httpclient.cookie;
 
+import java.util.Locale;
+
 import org.apache.commons.httpclient.NameValuePair;
 import org.apache.commons.httpclient.Cookie;
 import org.apache.commons.httpclient.util.ParameterFormatter;
@@ -87,7 +89,7 @@
         if (cookie == null) {
             throw new IllegalArgumentException("Cookie may not be null.");
         }
-        final String paramName = attribute.getName().toLowerCase();
+        final String paramName = attribute.getName().toLowerCase(Locale.ENGLISH);
         final String paramValue = attribute.getValue();
 
         if (paramName.equals("path")) {
@@ -164,7 +166,7 @@
                     + cookie.getDomain() 
                     + "\" violates RFC 2109: domain must contain an embedded dot");
             }
-            host = host.toLowerCase();
+            host = host.toLowerCase(Locale.ENGLISH);
             if (!host.endsWith(cookie.getDomain())) {
                 throw new MalformedCookieException(
                     "Illegal domain attribute \"" + cookie.getDomain() 

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java
Sat May  3 05:42:39 2008
@@ -38,6 +38,7 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.StringTokenizer;
 
@@ -275,7 +276,7 @@
                 Map attribmap = new HashMap(parameters.length); 
                 for (int j = parameters.length - 1; j >= 0; j--) {
                     NameValuePair param = parameters[j];
-                    attribmap.put(param.getName().toLowerCase(), param);
+                    attribmap.put(param.getName().toLowerCase(Locale.ENGLISH), param);
                 }
                 for (Iterator it = attribmap.entrySet().iterator(); it.hasNext(); ) {
                     Map.Entry entry = (Map.Entry) it.next();
@@ -309,7 +310,7 @@
         if (cookie == null) {
             throw new IllegalArgumentException("Cookie may not be null.");
         }
-        final String paramName = attribute.getName().toLowerCase();
+        final String paramName = attribute.getName().toLowerCase(Locale.ENGLISH);
         final String paramValue = attribute.getValue();
 
         CookieAttributeHandler handler = findAttribHandler(paramName);
@@ -556,7 +557,7 @@
      * @return
      */
     private static String getEffectiveHost(final String host) {
-        String effectiveHost = host.toLowerCase();
+        String effectiveHost = host.toLowerCase(Locale.ENGLISH);
         if (host.indexOf('.') < 0) {
             effectiveHost += ".local";
         }
@@ -712,7 +713,7 @@
                 throw new MalformedCookieException(
                         "Blank value for domain attribute");
             }
-            domain = domain.toLowerCase();
+            domain = domain.toLowerCase(Locale.ENGLISH);
             if (!domain.startsWith(".")) {
                 // Per RFC 2965 section 3.2.2
                 // "... If an explicitly specified value does not start with
@@ -736,12 +737,12 @@
             if (origin == null) {
                 throw new IllegalArgumentException("Cookie origin may not be null");
             }
-            String host = origin.getHost().toLowerCase();
+            String host = origin.getHost().toLowerCase(Locale.ENGLISH);
             if (cookie.getDomain() == null) {
                 throw new MalformedCookieException("Invalid cookie state: " +
                                                    "domain not specified");
             }
-            String cookieDomain = cookie.getDomain().toLowerCase();
+            String cookieDomain = cookie.getDomain().toLowerCase(Locale.ENGLISH);
 
             if (cookie.isDomainAttributeSpecified()) {
                 // Domain attribute must start with a dot
@@ -799,7 +800,7 @@
             if (origin == null) {
                 throw new IllegalArgumentException("Cookie origin may not be null");
             }
-            String host = origin.getHost().toLowerCase();
+            String host = origin.getHost().toLowerCase(Locale.ENGLISH);
             String cookieDomain = cookie.getDomain();
 
             // The effective host name MUST domain-match the Domain

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/methods/OptionsMethod.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/methods/OptionsMethod.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/methods/OptionsMethod.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/methods/OptionsMethod.java
Sat May  3 05:42:39 2008
@@ -38,6 +38,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.logging.Log;
 import java.util.Enumeration;
+import java.util.Locale;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
@@ -169,7 +170,7 @@
                 new StringTokenizer(allowHeaderValue, ",");
             while (tokenizer.hasMoreElements()) {
                 String methodAllowed =
-                    tokenizer.nextToken().trim().toUpperCase();
+                    tokenizer.nextToken().trim().toUpperCase(Locale.ENGLISH);
                 methodsAllowed.addElement(methodAllowed);
             }
         }

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/params/DefaultHttpParamsFactory.java
Sat May  3 05:42:39 2008
@@ -32,6 +32,7 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Locale;
 
 import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
 import org.apache.commons.httpclient.HttpVersion;
@@ -115,7 +116,7 @@
         } catch (SecurityException ignore) {
         }
         if (preemptiveDefault != null) {
-            preemptiveDefault = preemptiveDefault.trim().toLowerCase();
+            preemptiveDefault = preemptiveDefault.trim().toLowerCase(Locale.ENGLISH);
             if (preemptiveDefault.equals("true")) {
                 params.setParameter(HttpClientParams.PREEMPTIVE_AUTHENTICATION, Boolean.TRUE);
             } else if (preemptiveDefault.equals("false")) {

Modified: httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/protocol/Protocol.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/protocol/Protocol.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/protocol/Protocol.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/java/org/apache/commons/httpclient/protocol/Protocol.java
Sat May  3 05:42:39 2008
@@ -31,6 +31,7 @@
 
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.commons.httpclient.util.LangUtils;
@@ -288,7 +289,7 @@
     public int hashCode() {
         int hash = LangUtils.HASH_SEED;
         hash = LangUtils.hashCode(hash, this.defaultPort);
-        hash = LangUtils.hashCode(hash, this.scheme.toLowerCase());
+        hash = LangUtils.hashCode(hash, this.scheme.toLowerCase(Locale.ENGLISH));
         hash = LangUtils.hashCode(hash, this.secure);
         hash = LangUtils.hashCode(hash, this.socketFactory);
         return hash;

Modified: httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestExceptions.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestExceptions.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestExceptions.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestExceptions.java
Sat May  3 05:42:39 2008
@@ -34,6 +34,7 @@
 import java.io.PrintStream;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.util.Locale;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -125,7 +126,7 @@
         
         Throwable cause = exception.getCause();
         if (cause != null) {
-            assertTrue("Contains 'cause'", stackTrace.toLowerCase().indexOf("cause") != -1);
+            assertTrue("Contains 'cause'", stackTrace.toLowerCase(Locale.ENGLISH).indexOf("cause")
!= -1);
             assertTrue("Contains cause.toString()", stackTrace.indexOf(cause.toString())
!= -1);
         }
     }

Modified: httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestHeaderOps.java
URL: http://svn.apache.org/viewvc/httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestHeaderOps.java?rev=653067&r1=653066&r2=653067&view=diff
==============================================================================
--- httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestHeaderOps.java
(original)
+++ httpcomponents/oac.hc3x/trunk/src/test/org/apache/commons/httpclient/TestHeaderOps.java
Sat May  3 05:42:39 2008
@@ -32,6 +32,7 @@
 import java.io.IOException;
 import java.net.InetAddress;
 import java.util.Iterator;
+import java.util.Locale;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -83,7 +84,7 @@
             for (Iterator i = request.getHeaderIterator(); i.hasNext(); ) {
                 Header header = (Header) i.next();
                 buffer.append("name=\"");
-                buffer.append(header.getName().toLowerCase());
+                buffer.append(header.getName().toLowerCase(Locale.ENGLISH));
                 buffer.append("\";value=\"");
                 buffer.append(header.getValue());
                 buffer.append("\"\r\n");



Mime
View raw message