Skip to content

Commit

Permalink
HTTPCLIENT-969: BasicCookieStore#getCookies() to return a copy of Coo…
Browse files Browse the repository at this point in the history
…kie list

Contributed by David Smiley <dsmiley at mitre.org>


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x@967234 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ok2c committed Jul 23, 2010
1 parent ef067cb commit c43a508
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -116,7 +115,7 @@ public synchronized void addCookies(Cookie[] cookies) {
* @return an array of {@link Cookie cookies}.
*/
public synchronized List<Cookie> getCookies() {
return Collections.unmodifiableList(this.cookies);
return new ArrayList<Cookie>(this.cookies);
}

/**
Expand Down

0 comments on commit c43a508

Please sign in to comment.