hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1644165 - in /httpcomponents/httpclient/trunk/httpclient/src: main/java/org/apache/http/impl/cookie/BasicClientCookie.java test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java
Date Tue, 09 Dec 2014 20:20:06 GMT
Author: olegk
Date: Tue Dec  9 20:20:06 2014
New Revision: 1644165

URL: http://svn.apache.org/r1644165
Log:
Corrected handling of cookie attributes with null value

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java?rev=1644165&r1=1644164&r2=1644165&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java
Tue Dec  9 20:20:06 2014
@@ -315,7 +315,14 @@ public class BasicClientCookie implement
 
     @Override
     public boolean containsAttribute(final String name) {
-        return this.attribs.get(name) != null;
+        return this.attribs.containsKey(name);
+    }
+
+    /**
+     * @since 4.4
+     */
+    public boolean removeAttribute(final String name) {
+        return this.attribs.remove(name) != null;
     }
 
     @Override

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java?rev=1644165&r1=1644164&r2=1644165&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java
Tue Dec  9 20:20:06 2014
@@ -399,8 +399,8 @@ public class TestCookieRFC2109Spec {
         Assert.assertEquals(1, headers.size());
         Assert.assertEquals("$Version=0; name=; $Path=/", headers.get(0).getValue());
 
-        cookie.setAttribute(ClientCookie.DOMAIN_ATTR, null);
-        cookie.setAttribute(ClientCookie.PATH_ATTR, null);
+        cookie.removeAttribute(ClientCookie.DOMAIN_ATTR);
+        cookie.removeAttribute(ClientCookie.PATH_ATTR);
         cookies = new ArrayList<Cookie>();
         cookies.add(cookie);
         headers = cookiespec.formatCookies(cookies);



Mime
View raw message