That's correct. When you add something to it any Iterators you have on it are invalidated.
Either defer the inserts until after you are done iterating (maybe add the stuff temporarilly to another Collection and later use addAll on the LinkedHashSet to add the content of that Collection or loop through the LinkedHashSet in some other way.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337