RE: question on iterators

"Krijgsheld, Ronald" <[email protected]> Wed, 25 Jun 2003 16:28:34 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <D913221A882FD31198D90008C75D690906BF0CB6@cwnl-ams-pri01.nl.compuware.com>
Hi Martin,

It does not throw a ConcurrentModificationException, it returns false from
hasNext(). I checked if there are subtyped created but that is not the case.


I tried to trace what happens inside MDR, but have to dive in some deeper to
fully understand the btree logic.

Also, when I make a copy of that collection and then iterate, everything
runs fine. any suggestions on how to proceed?

Ronald.

-----Original Message-----
From: Martin Matula [mailto:[email protected]]
Sent: Wednesday, June 25, 2003 4:23 PM
To: [email protected]
Subject: Re: [mdr-dev] question on iterators


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
> 
> 



-- 
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.