Hi Daniel
I seem to have lost some of the thread of this discussion so its a bit
confusing to me. I'll try my best to answer...
From: "Daniel Rall" <[EMAIL PROTECTED]>
> "Craig R. McClanahan" <[EMAIL PROTECTED]> writes:
>
> > On 24 Aug 2001, Daniel Rall wrote:
> >
> > > I really wanted to have the Util pacakge not depend upon any other
> > > libraries. Do you think we should make an exception in case of the
> > > Collections library?
> >
> > It certainly seems that the collections package should have an
> > EnumerationIterator in it -- that's a very useful adapter between the
old
> > style and new style collection classes.
It has done for quite some time.
> Yes, I agree. Bay had noted that a version already existed in the
> Collections package. I found an EnumerationIterator by by James
> Strachan which approximates the version I just checked in. It doesn't
> implement the remove() method, which I'd be happy to submit a patch
> for.
Cool.
> > You could make the same sort of case that a version of
SequencedHashtable
> > should go there also.
>
> I would rather SequencedHashtable just moved into the Collections
> package. I brought it up before (pre-Util), but at the time didn't
> have the bandwidth to compare it to functionality existing in the
> Collections package.
>
> On looking now, I don't see a duplicate of it. LRUMap appears to be
> very close to an unsyncrhonized version of BufferCache.
Remember you can synchronize a Collection or Map using the helper methods in
java.util.Collections.
Map syncedMap = Collections.synchronizedMap( map );
So I tend to make all Map or Collection implementations non-synchronized by
default.
> > As for whether commons-util should have their own copy, that seems a
> > tougher call (although I note that "no dependencies" was part of the
> > original intent).
>
> I do not want to duplicate classes.
Agreed.
> > Are there really that many use cases where commons-util
> > would be included and commons-collections would not?
>
> I don't think so, though the opposite might be true (at least until
> the Util package is released and starts getting more acceptance).
>
> I propose that CollectionUtils, SequencedHashtable and BufferCache
> (and tests) move into the Collections package. This will free Util
> from any duplication or external dependency. Though BufferCache
> overlaps LRUMap to some extent, it would make it easier on me if we
> could do a straight move for the time being, then handle any necessary
> merging at a later.
I'd like find out what BufferCache does that LRUMap doesn't do (other than
synchronization). What are CollectionUtils, SequencedHashtable and
BufferCache?
> Hopefully James can help evaluate whether such a
> merge is desirable. Note that I do not have commit access to
> Collections, but I would like to have it as it is an area I am both
> interested in and would likely be able to contribute in. Comments?
I'll apply your patch if you like.
James
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com