stefan      2004/06/21 07:43:44

  Modified:    proposals/jcrri/src/org/apache/slide/jcr/core/state
                        ItemStateCache.java
  Log:
  jcrri
  
  Revision  Changes    Path
  1.3       +10 -4     
jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/state/ItemStateCache.java
  
  Index: ItemStateCache.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/state/ItemStateCache.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ItemStateCache.java       21 Jun 2004 09:37:42 -0000      1.2
  +++ ItemStateCache.java       21 Jun 2004 14:43:44 -0000      1.3
  @@ -29,6 +29,8 @@
   
   import java.util.Iterator;
   import java.util.Map;
  +import java.util.Collection;
  +import java.util.ArrayList;
   
   /**
    * An <code>ItemStateCache</code> maintains a cache of <code>ItemState</code>
  @@ -140,7 +142,9 @@
        * @return an iterator of the keys of the cached entries.
        */
       protected Iterator keys() {
  -     return cache.keySet().iterator();
  +     // use temp collection to avoid ConcurrentModificationException
  +     Collection tmp = new ArrayList(cache.keySet());
  +     return tmp.iterator();
       }
   
       /**
  @@ -150,6 +154,8 @@
        * @return an iterator of the entries in the cache.
        */
       protected Iterator entries() {
  -     return cache.entrySet().iterator();
  +     // use temp collection to avoid ConcurrentModificationException
  +     Collection tmp = new ArrayList(cache.values());
  +     return tmp.iterator();
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to