Re: question on iterators

Martin Matula <[email protected]> Wed, 25 Jun 2003 16:22:33 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Hi Ronald,
how does the iterator stop? Does it throw 
ConcurrentModificationException? Or it just returns false from hasNext? 
allOfType returns not only instances of a specific type but also of its 
subtypes. Are you sure you are not adding any of those?
Martin

Krijgsheld, Ronald wrote:
> Hello,
> 
> I am interested in the lifespan of an iterator.
> 
> What I mean is that I query on some factory all instances with refAllOfType
> and then get an iterator from that collection. While iterating over that
> collection I insert a lot of other thingies in the repository, but not
> anything of the type over which I am iterating.
> 
> Now, my iteration stops after one step, while there are five elements in
> that collection.
> 
> Do I use the iterator illegally?
> 
> Bye,
> 
> Ronald Krijgsheld
> 
>