classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More on java.util.HashMap...


From: Bryce McKinlay
Subject: Re: More on java.util.HashMap...
Date: Tue, 25 Sep 2001 13:44:14 +1200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010913

Eric Blake wrote:

Thanks for all the recent comments on my contributions in
java.util.Hashtable, HashMap, and such.  Where people have cast doubt on
the efficiency of my prior patches, I've reverted those.

Thanks Eric.

You introduced a bug in Hashtable.toString, I'm checking in the fix:

--- java/util/Hashtable.java    2001/09/20 23:38:12     1.17
+++ java/util/Hashtable.java    2001/09/25 01:01:33
@@ -557,7 +557,7 @@
    for (int pos = size; pos > 0; pos--)
      {
        r.append(entries.next());
-        if (pos == 1)
+        if (pos > 1)
          r.append(", ");
      }
    r.append("}");

I also just added LinkedHashMap (new in JDK 1.4), and would like another
pair of eyes to look over my work to check for any glaring bugs or items
that could be improved.
Looking at LinkedHashMap, I think it would make sense to change the HashMap.clone() to simply call putAll(this). This way we get rid of a bunch of clone related code, and it should not be significantly less efficient.

regards

Bryce.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]