Patch: FYI: Re: fix to LinkedHashMap.java

Bryce McKinlay mckinlay@redhat.com
Sat Feb 19 03:46:00 GMT 2005


Thanks for spotting this. We actually have a mauve test case for this 
but it wasn't enabled due to a tags typo! I'm checking in the following 
patch.

Bryce


2005-02-18  Bryce McKinlay  <mckinlay@redhat.com>

    * java/util/LinkedHashMap (addEntry): Call remove() with key argument,
    not the HashEntry. Reported by Jean-Marie White.

--- java/util/LinkedHashMap.java        6 Nov 2002 14:03:43 -0000       1.6
+++ java/util/LinkedHashMap.java        19 Feb 2005 03:13:42 -0000
@@ -412,7 +412,7 @@
     e.next = buckets[idx];
     buckets[idx] = e;
     if (callRemove && removeEldestEntry(root))
-      remove(root);
+      remove(root.key);
   }
 
   /**




Eric Blake wrote:

>Sorry I haven't cleaned my inbox in a while, you mailed an account I no
>longer actively track, since I no longer have time to actively develop on
>classpath.  Please send bug reports to the project mailing list, and not
>an individual developer, if you want faster response.
>
>According to Jean-Marie White on 11/18/2004 5:44 PM:
>  
>
>>Hi Eric,
>>
>>just a quick note to let you know that I fixed a bug in LinkedHashMap.java.
>>
>>In method  void addEntry(Object key, Object value, int idx, boolean
>>callRemove), the remove call should read:
>>
>>remove(root.key)
>>
>>and not
>>
>>remove(root)
>>
>>(You always remove a map entry by key, not by the entry itself)
>>
>>This may or may not have been fixed, but thought would let you know anyway.
>>
>>Thanks for your implementing the class in the first place!!!
>>jm
>>    
>>



More information about the Java-patches mailing list