• Post Reply Bookmark Topic Watch Topic
  • New Topic

Concurrent Modification Exception Error.  RSS feed

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all,

I am trying to figure out the error in my code. So far i couldnt find out. I have gone through other people's post and reply.



From other post, I do understand that it is impossible to add during iteration. Is there any other way to add a collection?

Just to inform you that hotelWizardBean is a collections of list and objects .

Any help will be grateful.
thanks
Philip
 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This happens if the underlying collection is modified structurally during the iteration (as the add method does). You can use a ListIterator instead of an Iterator; it has methods that can modify the underlying collection during the iteration (provided the collection allows that).
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to add the plan again in the list.
It is already in the list.
 
Philip Zac
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Rodrigo Lopes and Ulf for the quickest reply.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!