Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 67231 invoked from network); 28 Mar 2006 09:34:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Mar 2006 09:34:16 -0000 Received: (qmail 59625 invoked by uid 500); 28 Mar 2006 09:33:47 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 59591 invoked by uid 500); 28 Mar 2006 09:33:46 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 59580 invoked by uid 99); 28 Mar 2006 09:33:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2006 01:33:46 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2006 01:33:46 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 5D791D49FE for ; Tue, 28 Mar 2006 10:33:25 +0100 (BST) Message-ID: <1458080165.1143538405344.JavaMail.jira@ajax> Date: Tue, 28 Mar 2006 10:33:25 +0100 (BST) From: "Tim Ellison (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Resolved: (HARMONY-262) java.util.Hashtable, same as HashMap, has similar non-compatible behavior with RI In-Reply-To: <684811590.1143526939454.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-262?page=all ] Tim Ellison resolved HARMONY-262: --------------------------------- Resolution: Fixed Thanks Paulex, Patch looks good, applied to LUNI module java.util.Hashtable at repo revision 389451. Please check that the patch was applied as you expected. > java.util.Hashtable, same as HashMap, has similar non-compatible behavior with RI > --------------------------------------------------------------------------------- > > Key: HARMONY-262 > URL: http://issues.apache.org/jira/browse/HARMONY-262 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Paulex Yang > Assignee: Tim Ellison > Attachments: JIRA262.patch > > Same situation with the prior HashMap issue(http://issues.apache.org/jira/browse/HARMONY-206), the Hashtable is non-compatible with RI when key is reused with different hash. > Following test case show the non-compatiblity, it passes on RI but fails on Harmony. > public class HashTableTest extends extends junit.framework.TestCase{ > public void test_getLjava_lang_Object() { > ReusableKey k = new ReusableKey(); > Hashtable h2 = new Hashtable(); > k.setKey(1); > h2.put(k, "value1"); > k.setKey(13); > assertNull(h2.get(k)); > k.setKey(12); > assertNull(h2.get(k)); > } > static class ReusableKey { > private int key = 0; > public void setKey(int key) { > this.key = key; > } > public int hashCode() { > return key; > } > public boolean equals(Object o) { > if (o == this) { > return true; > } > if (!(o instanceof ReusableKey)) { > return false; > } > return key == ((ReusableKey) o).key; > } > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira