commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morgan Delagrange <mdela...@yahoo.com>
Subject Re: [Collections] Bug or Feature? - SequencedHashMap iterators do not throw ConcurrentModificationExceptions
Date Thu, 09 May 2002 15:20:18 GMT
Great, now all we have to do is figure out what kind
of release this necessitates.  It's a bug fix for
LRUMap, but I'm a little nervous because it will
probably introduce new exceptions to a few clients.

I think it's acceptable to release this as Collections
2.0.1, yes?

- Morgan

--- "Michael A. Smith" <michael@iammichael.org> wrote:
> On Wed, 8 May 2002, Michael A. Smith wrote:
> > Another solution would be to fix the end of the
> list at the time of
> > iterator creation.  That way, new elements aren't
> reflected in previously
> > created iterators.  I like that better than
> throwing 
> > ConcurrentModificationException.  That should be a
> fairly easy fix and I 
> > can put that in this evening.  
> 
> It turns out, this doesn't work.  At least not
> easily.  At first, I 
> thought I could just save the last entry, and don't
> let the iterator 
> iterate past it; however, if the last entry is
> removed before the iterator 
> gets to it, that last entry will never be reached
> and you still may end up 
> in an infinite loop.
> 
> The only way I could think of to get around that
> would be to add a
> monotonically increasing "id"  of some kind to each
> entry and store the id 
> of the last entry.  If the iterator reaches an entry
> with an id greater 
> than it's saved id, then the iterator stops. 
> However, that seems like a 
> large memory waste.
> 
> Instead, I modified things to throw a concurrent
> modification exception.  
> My commit message should come across momentarily.
> 
> regards,
> michael
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
> 


=====
Morgan Delagrange
http://jakarta.apache.org/taglibs
http://jakarta.apache.org/commons
http://axion.tigris.org

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!
http://shopping.yahoo.com

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message