chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1214815 - /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieStoreImpl.java
Date Thu, 15 Dec 2011 15:54:35 GMT
Author: fmui
Date: Thu Dec 15 15:54:35 2011
New Revision: 1214815

URL: http://svn.apache.org/viewvc?rev=1214815&view=rev
Log:
fixed concurrency issue

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieStoreImpl.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieStoreImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieStoreImpl.java?rev=1214815&r1=1214814&r2=1214815&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieStoreImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/cookies/CmisCookieStoreImpl.java
Thu Dec 15 15:54:35 2011
@@ -30,7 +30,6 @@ import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 /**
  * Provides an in-memory cookie store.
@@ -92,7 +91,7 @@ class CmisCookieStoreImpl implements Ser
         }
 
         // get cookies whose domain matches the given URI
-        Set<URI> uris = storeMap.keySet();
+        List<URI> uris = new ArrayList<URI>(storeMap.keySet());
         for (URI u : uris) {
             // exclude the given URI
             if (!u.equals(uri)) {
@@ -101,6 +100,9 @@ class CmisCookieStoreImpl implements Ser
                     if (CmisHttpCookie.domainMatches(cookie.getDomain(), uri.getHost()))
{
                         if (cookie.hasExpired()) {
                             listCookie.remove(cookie);
+                            if (listCookie.isEmpty()) {
+                                storeMap.remove(u);
+                            }
                         } else if (!(cookie.hasExpired() || cookies.contains(cookie))) {
                             cookies.add(cookie);
                         }



Mime
View raw message