hi forum,
i hv used an iterator to parse over the contents of a LinkedHashSet collection.while iterating i hv to add new contents(URL links) to the collection.but adding of new content after the creation of an iterator throws an exception.I must use this particular collection for my program.i m in a real bother over this.can anyone help?thanks.

p.s.this is related with my previous posts over implementation of a web crawler.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.