Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Dave Newton
No no, I mean that even if you're not modifying the map you can get a concurrent modification exception by accessing the map via OGNL's [] notation, just in an tag. Dave --- Eduardo Dela Rosa <[EMAIL PROTECTED]> wrote: > You are right there. And I guess the best way to rid this exception then i

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Randy Burgess
; To: Struts Users Mailing List > Subject: Re: java.util.ConcurrentModificationException at IteratorComponent > > You are right there. And I guess the best way to rid this exception then is > to have the code part in synchronized block, i.e., synchronizing on the list > object itself +

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Eduardo Dela Rosa
You are right there. And I guess the best way to rid this exception then is to have the code part in synchronized block, i.e., synchronizing on the list object itself + get the iterator + invoke either "add" or "remove" inside the block. This will hurt the performance a bit BUT will preserve the in

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Dave Newton
--- Eduardo Dela Rosa <[EMAIL PROTECTED]> wrote: > Also, you must be removing or updating object directly inside your list > object which is why you're getting this error. Try to get a reference to > Iterator from your ArrayList object and invoke "remove" or "add" methods > via the Iterator to get

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Eduardo Dela Rosa
You stick to your code. However, update your code part such that when create your ArrayList, do it as Collections.synchronizedList(new ArrayList(...)). Also, you must be removing or updating object directly inside your list object which is why you're getting this error. Try to get a reference to

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Dave Newton
--- Othon Reyes Sanchez <[EMAIL PROTECTED]> wrote: > do you know a collection that is thread safe? Look in the JavaDocs: not only are there thread-safe collections but there are utility methods to create them from non-thread-safe collections. As I said in your JIRA post you should post the action

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Othon Reyes Sanchez
do you know a collection that is thread safe? On Tue, Feb 26, 2008 at 12:42 PM, Randy Burgess <[EMAIL PROTECTED]> wrote: > I believe this exception occurs when you try and modify an ArrayList while > iterating over said list. ArrayList is not thread safe. > > Regards, > Randy Burgess > Sr. Web A

Re: java.util.ConcurrentModificationException at IteratorComponent

2008-02-26 Thread Randy Burgess
I believe this exception occurs when you try and modify an ArrayList while iterating over said list. ArrayList is not thread safe. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications > From: Othon Reyes Sanchez <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List >