Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 46817 invoked from network); 4 Jul 2006 09:31:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Jul 2006 09:31:57 -0000 Received: (qmail 31565 invoked by uid 500); 4 Jul 2006 09:31:57 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 31532 invoked by uid 500); 4 Jul 2006 09:31:56 -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 31521 invoked by uid 99); 4 Jul 2006 09:31:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jul 2006 02:31:56 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jul 2006 02:31:55 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D857D1A983A; Tue, 4 Jul 2006 02:31:35 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r418963 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/HashMap.java test/java/tests/api/java/util/HashMapTest.java Date: Tue, 04 Jul 2006 09:31:35 -0000 To: harmony-commits@incubator.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060704093135.D857D1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: tellison Date: Tue Jul 4 02:31:34 2006 New Revision: 418963 URL: http://svn.apache.org/viewvc?rev=418963&view=rev Log: *Rolling back* : Apply patch and additional fixes for HARMONY-403: HashMap hashcode ignores values in entries Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/HashMapTest.java Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java?rev=418963&r1=418962&r2=418963&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/HashMap.java Tue Jul 4 02:31:34 2006 @@ -47,8 +47,7 @@ Entry(K theKey, V theValue) { super(theKey, theValue); - this.hash = (theKey == null ? 0 : theKey.hashCode()) - ^ (theValue == null ? 0 : theValue.hashCode()); + this.hash = (theKey == null) ? 0 : theKey.hashCode(); } @Override @@ -524,11 +523,8 @@ index = key == null ? 0 : (key.hashCode() & 0x7FFFFFFF) % elementData.length; } - entry = createEntry(key, index, value); - //new entry, so nothing is replaced - return null; + entry = createEntry(key, index, null); } - V result = entry.value; entry.value = value; return result; Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/HashMapTest.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/HashMapTest.java?rev=418963&r1=418962&r2=418963&view=diff ============================================================================== --- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/HashMapTest.java (original) +++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/HashMapTest.java Tue Jul 4 02:31:34 2006 @@ -409,20 +409,6 @@ return key == ((ReusableKey) o).key; } } - - public void test_hashCode() { - HashMap map = new HashMap(10); - Integer key = new Integer(1); - Integer val = new Integer(2); - map.put(key, val); - int expected = key.hashCode() ^ val.hashCode(); - assertEquals(expected, map.hashCode()); - key = new Integer(4); - val = new Integer(8); - map.put(key, val); - expected += key.hashCode() ^ val.hashCode(); - assertEquals(expected, map.hashCode()); - } /** * Sets up the fixture, for example, open a network connection. This method