This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes ConcurrentModificationException why here ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "ConcurrentModificationException why here ?" Watch "ConcurrentModificationException why here ?" New topic

ConcurrentModificationException why here ?

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 348
I get a ConcurrentModificationException, but why here i create a new list

List<String> subListKundeNumre = kundeNumre.subList(0, 999);

And remove elements from the old list:


There is not two threads at the same time .... I can try to do in a other way, but i have to know, why i got this exception, any good ideas ?

// Frank :-)

Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

You don't need multiple threads to get that exception. All you need is for the list to be structurally modified other than through the active iterator. It states this right in the docs for the exception.

I agree. Here's the link:
subject: ConcurrentModificationException why here ?
Similar Threads
Select clause for listing cities for refined search
MultiDimenaional Array sort
static utility class from servlet
My CreateAlias / Restrictions dosent work, i cant figure out why ?
Sorting with Collator and Collections ??