PATCH: java.util.Collections and java.util.Vector

Bryce McKinlay bryce@albatross.co.nz
Wed Nov 22 16:00:00 GMT 2000


Tom Tromey wrote:

> Hey Bryce.  Were the old libgcj and Classpath Vector classes very
> different?  I have a vague memory that this was one of those classes
> where the libgcj implementation was slightly better and that we wanted
> to preserve that.  Chances are that I'm confusing it with some other
> class though :-(.  Do you know?

Vector is fine. There are some minor differences, like libgcj using
descending loops, but nothing very significant afaik. Hashtable, on the
other hand, has got issues. (given a modern cpu, is it really faster to
use a descending loop, or is that just an old hacker legend?)

> There's only a few collections classes missing.  Are you planning to
> merge these in?

I intend to look at Hashtable and HashMap soon. That just leaves TreeMap,
TreeSet, and HashSet. Classpath's TreeMap in particular is pretty nasty.
We might want to rewrite it. Also Collections.java needs to be looked
through and debugged.

> BTW, I remember once you mentioned some Java 2 Collections test cases
> available on the net.  What were these?  Where can I get them?

They're called MapBash, ListBash, and SetBash. They were at
javacollections.org but that has been unreachable recently.
Unfortunately, I lost my copies.

I am confident that AbstractList/ArrayList/LinkedList/Vector are now
pretty good implementations - the only known problems with them are due
to inner class miscompilation bugs ;-(

regards

  [ bryce ]




More information about the Java-patches mailing list