hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r967234 - /httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/client/BasicCookieStore.java
Date Fri, 23 Jul 2010 19:58:59 GMT
Author: olegk
Date: Fri Jul 23 19:58:58 2010
New Revision: 967234

URL: http://svn.apache.org/viewvc?rev=967234&view=rev
Log:
HTTPCLIENT-969: BasicCookieStore#getCookies() to return a copy of Cookie list 
Contributed by David Smiley <dsmiley at mitre.org>

Modified:
    httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/client/BasicCookieStore.java

Modified: httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/client/BasicCookieStore.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/client/BasicCookieStore.java?rev=967234&r1=967233&r2=967234&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/client/BasicCookieStore.java
(original)
+++ httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/impl/client/BasicCookieStore.java
Fri Jul 23 19:58:58 2010
@@ -27,7 +27,6 @@
 package org.apache.http.impl.client;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.Date;
 import java.util.Iterator;
@@ -116,7 +115,7 @@ public class BasicCookieStore implements
      * @return an array of {@link Cookie cookies}.
      */
     public synchronized List<Cookie> getCookies() {
-        return Collections.unmodifiableList(this.cookies);
+        return new ArrayList<Cookie>(this.cookies);
     }
 
     /**



Mime
View raw message