Re: question on iterators

Martin Matula <[email protected]> Wed, 25 Jun 2003 17:05:42 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Hi,
we had some problems with iterators in the past - basically the same 
behavior that you describe, but it was not necessarily related to 
concurent updates in the MDR while iterating. This bug was fixed several 
months ago I believe. Is there a chance that the version of MDR you are 
using is quite old and still has that bug?
If not, we will probably need a test case to reproduce it in order to be 
able to fix it. If you could create a short program that reproduces the 
bug, that would be great.
Martin

Krijgsheld, Ronald wrote:
> 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
>>
>>
> 
> 
> 
>