Harmony
  1. Harmony
  2. HARMONY-6419

[classlib][luni] Changes to IdentityHashMap entrySet doesn't reflect underlying map

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M12
    • Fix Version/s: 5.0M16
    • Component/s: Classlib
    • Labels:
      None

      Description

      The following test fails on Harmony.
      (With thanks to http://blogs.oracle.com/charlesLamb/2010/01/harmonydavlik_identityhashmap.html)

      import java.util.IdentityHashMap;
      import java.util.Set;
      import java.util.Map.Entry;

      import junit.framework.TestCase;

      public class IHMTest extends TestCase {

      public void testEntrySet()

      { IdentityHashMap<String, String> ihm = new IdentityHashMap<String, String>(); String key = "key"; String value = "value"; ihm.put(key, value); Set<Entry<String, String>> set = ihm.entrySet(); assertEquals(1, set.size()); Entry<String, String> entry = set.iterator().next(); String newValue = "newvalue"; entry.setValue(newValue); assertSame(newValue, ihm.get(key)); }

      }

      1. HARMONY-6419v2.diff
        4 kB
        Kevin Zhou
      2. 6419.patch
        3 kB
        Catherine Hope

        Activity

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Tim Ellison
          • Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development