You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2014/09/16 14:03:44 UTC

svn commit: r1625254 - /httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java

Author: olegk
Date: Tue Sep 16 12:03:44 2014
New Revision: 1625254

URL: http://svn.apache.org/r1625254
Log:
Fixed Java 1.5 incompatibility

Modified:
    httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java

Modified: httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java?rev=1625254&r1=1625253&r2=1625254&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java (original)
+++ httpcomponents/httpclient/branches/4.3.x/httpclient/src/main/java/org/apache/http/impl/cookie/BrowserCompatSpec.java Tue Sep 16 12:03:44 2014
@@ -50,6 +50,7 @@ import org.apache.http.message.BufferedH
 import org.apache.http.message.ParserCursor;
 import org.apache.http.util.Args;
 import org.apache.http.util.CharArrayBuffer;
+import org.apache.http.util.TextUtils;
 
 
 /**
@@ -170,7 +171,7 @@ public class BrowserCompatSpec extends C
             final HeaderElement elem = parser.parseHeader(buffer, cursor);
             final String name = elem.getName();
             final String value = elem.getValue();
-            if (name == null || name.isEmpty()) {
+            if (name == null || TextUtils.isBlank(name)) {
                 throw new MalformedCookieException("Cookie name may not be empty");
             }
             final BasicClientCookie cookie = new BasicClientCookie(name, value);
@@ -181,7 +182,7 @@ public class BrowserCompatSpec extends C
             final NameValuePair[] attribs = elem.getParameters();
             for (int j = attribs.length - 1; j >= 0; j--) {
                 final NameValuePair attrib = attribs[j];
-                final String s = attrib.getName().toLowerCase(Locale.ROOT);
+                final String s = attrib.getName().toLowerCase(Locale.ENGLISH);
                 cookie.setAttribute(s, attrib.getValue());
                 final CookieAttributeHandler handler = findAttribHandler(s);
                 if (handler != null) {