Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 49412 invoked from network); 6 Sep 2007 04:57:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Sep 2007 04:57:54 -0000 Received: (qmail 74191 invoked by uid 500); 6 Sep 2007 04:57:49 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 74166 invoked by uid 500); 6 Sep 2007 04:57:49 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 74156 invoked by uid 99); 6 Sep 2007 04:57:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2007 21:57:49 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2007 04:57:54 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C0E4F714163 for ; Wed, 5 Sep 2007 21:57:33 -0700 (PDT) Message-ID: <20093627.1189054653786.JavaMail.jira@brutus> Date: Wed, 5 Sep 2007 21:57:33 -0700 (PDT) From: "Sean Qiu (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-4750) [classlib][luni] HashMap.HashMapEntrySet.contains(Object) cannot find custmized entry without override the equal method In-Reply-To: <7677722.1189047821603.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sean Qiu updated HARMONY-4750: ------------------------------ Attachment: Harmony-4750.diff > [classlib][luni] HashMap.HashMapEntrySet.contains(Object) cannot find custmized entry without override the equal method > ----------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-4750 > URL: https://issues.apache.org/jira/browse/HARMONY-4750 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Sean Qiu > Attachments: Harmony-4750.diff > > > Description: > HashMap.HashMapEntrySet.contains(Object) cannot find custmized entry if the entry hasn't override the equal method. > Testcase: > @SuppressWarnings("unchecked") > public void test_EntrySet(){ > HashMap map = new HashMap(); > map.put(new Integer(1), "ONE"); > > Set entrySet = map.entrySet(); > Iterator e = entrySet.iterator(); > Object a = e.next(); > assertFalse(e.hasNext()); > > Map.Entry entry = new MockEntry(); > assertTrue(entrySet.contains(entry)); > entrySet.remove(entry); > assertFalse(entrySet.contains(entry)); > } > > private static class MockEntry implements Map.Entry{ > public Object getKey() { > return new Integer(1); > } > public Object getValue() { > return "ONE"; > } > public Object setValue(Object object) { > return null; > } > } > Result: > RI can pass this test while harmony will fail. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.