You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sian January (JIRA)" <ji...@apache.org> on 2009/05/14 11:29:07 UTC

[jira] Assigned: (HARMONY-6205) [classlib][luni] java.util.IdentityHashMap.clone() should return a shallow copy of this identity hash map

     [ https://issues.apache.org/jira/browse/HARMONY-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sian January reassigned HARMONY-6205:
-------------------------------------

    Assignee: Sian January

> [classlib][luni] java.util.IdentityHashMap.clone() should return a shallow copy of this identity hash map
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6205
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6205
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Sian January
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6205.diff
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> The Java Spec specifies that java.util.IdentityHashMap.clone() should return a shallow copy of this identity hash map. But in Harmony code, any changes to the original IdentityHashMap may affect the cloned one. Given a test case [1], RI passes it but HARMONY fails since the hashMap and cloned map share the same data.
> [1] Test Case:
> public void test_clone() {
>     IdentityHashMap hashMap = new IdentityHashMap();
>     Object cloneHashMap = hashMap.clone();
>     hashMap.put("key", "value");
>     assertEquals("value", hashMap.get("key"));
>     assertNull(((IdentityHashMap) cloneHashMap).get("key"));
> } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.