Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 64869 invoked from network); 7 Aug 2007 05:34:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Aug 2007 05:34:22 -0000 Received: (qmail 40716 invoked by uid 500); 7 Aug 2007 05:34:21 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 40697 invoked by uid 500); 7 Aug 2007 05:34:21 -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 40688 invoked by uid 99); 7 Aug 2007 05:34:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2007 22:34:21 -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; Tue, 07 Aug 2007 05:34:13 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 17B117141E2 for ; Mon, 6 Aug 2007 22:33:59 -0700 (PDT) Message-ID: <13632470.1186464839070.JavaMail.jira@brutus> Date: Mon, 6 Aug 2007 22:33:59 -0700 (PDT) From: "Sean Qiu (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-4603) [classlib][util] LinkedHashMap.clone() has problem when override the removeEldestEntry method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [classlib][util] LinkedHashMap.clone() has problem when override the removeEldestEntry method --------------------------------------------------------------------------------------------- Key: HARMONY-4603 URL: https://issues.apache.org/jira/browse/HARMONY-4603 Project: Harmony Issue Type: Bug Components: Classlib Reporter: Sean Qiu LinkedHashMap.clone() has problem when override the removeEldestEntry method ===== Test ===== public class LinkedHashMapTest extends TestCase { public void test_clone() { LinkedHashMap hashMap = new MockMap(); String value = "value a"; hashMap.put("key", value); MockMap cloneMap = (MockMap) hashMap.clone(); assertEquals(value, cloneMap.get("key")); assertEquals(hashMap, cloneMap); assertEquals(1, cloneMap.num); hashMap.put("key", "value b"); assertFalse(hashMap.equals(cloneMap)); } class MockMap extends LinkedHashMap { int num; public Object put(Object k, Object v) { num++; return super.put(k, v); } protected boolean removeEldestEntry(Map.Entry e) { return num > 1; } } } === Result === RI: Pass Harmy: Fail -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.