aspose file tools*
The moose likes Java in General and the fly likes Error: Concurrent Modification Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Error: Concurrent Modification Exception" Watch "Error: Concurrent Modification Exception" New topic
Author

Error: Concurrent Modification Exception

Leticia Barbalho
Ranch Hand

Joined: Sep 02, 2005
Posts: 37
Hello guys,

I'm getting the following error:



The thing is that I'm not finding where the error is exactly. Here comes my code:



What am I doing that I should not do? What's so wrong? For as far as I know that's the only way of doing what I want. And I still don't see my error.

Anyone could help? Thanks
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Your error is clear. While you are iterating over listAcumulador with
ListIterator acumuladorIt, you are applying add and remove methods to
listAcumulador -- this is enough to cause the exception.

I don't understand your code so I can't suggest specific code, but
among your options is to (1) use *ListIterator's* add and remove methods,
or (2) make a copy of your list and iterator over the copy, but
change the original list (be careful if you choose to do this!).


There is no emoticon for what I am feeling!
 
Consider Paul's rocket mass heater.
 
subject: Error: Concurrent Modification Exception
 
Similar Threads
EJB application error using struts F/W
hibernate error
Class Cast Exception
RequestProcessor problem on a cluster
Action Message error