This MAY be due to the treeMap.put(). You are not
allowed to change a map object while you are iterating
over it except via the setValue() method on the
iterator.

Stephen

 --- Alp Şehiç <[EMAIL PROTECTED]> wrote: 
> Hi there,
> 
> at the time I'm facing with a problem on the usage
> of LRUMap, so in the 
> code below;
> 
> final MapIterator mapIt = map.mapIterator(); // map
> is a LRUMap instance...
>             final TreeMap treeMap = new TreeMap();
>             while (mapIt.hasNext())
>             {
>                 if 
>
(mapIt.next().toString().endsWith("_DEPARTMENT_NAME"))
> // EXCEPTION IS 
> THROWN RIGHT HERE...
>                 {
>                     int temp =
>                         Integer.parseInt(
>                            
> mapIt.getKey().toString().substring(0, 4));
>                     if (temp >= getFirstNo() && temp
> <= getLastNo())
>                     {
>                         treeMap.put(mapIt.getKey(),
> mapIt.getValue());
>                     }
>                 }
>             }
> 
> I'm getting :
> 
> java.lang.ExceptionInInitializerError: 
> java.util.ConcurrentModificationException
>     at 
>
org.apache.commons.collections.map.AbstractLinkedMap$LinkIterator.nextEntry(AbstractLinkedMap.java:555)
>     at 
>
org.apache.commons.collections.map.AbstractLinkedMap$LinkMapIterator.next(AbstractLinkedMap.java:367)
>     at Support.initParameters(Support.java:486)
>     at Support.<clinit>(Support.java:72)
>     at Store..<clinit>(Magaza.java:52)
> 
> so is there something wrong with my usage ? 
> thanx in advance...
> 
> 
>  

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

Reply via email to