harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6205) [classlib][luni] java.util.IdentityHashMap.clone() should return a shallow copy of this identity hash map
Date Tue, 12 May 2009 06:06:45 GMT
[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
             Fix For: 5.0M10


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.


Mime
View raw message