Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6498

[classlib][luni] java.util.LinkedHashMap doesn't implement Map<K, V> interface

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0M13
    • 6.0M2
    • Classlib
    • None
    • Moderate

    Description

      According to Java Spec, java.util.LinkedHashMap should extend HashMap class and implement Map interface. But as to our implementation, HY seems doesn't implement the Map interface. Given a simple test case [1], HY fails while RI passes.

      [1] TestCase:
      public void test_getInterfaces()

      { Class<?>[] interfaces = HashMap.class.getInterfaces(); assertEquals(3, interfaces.length); List<Class<?>> interfaceList = Arrays.asList(interfaces); assertTrue(interfaceList.contains(Map.class)); assertTrue(interfaceList.contains(Cloneable.class)); assertTrue(interfaceList.contains(Serializable.class)); interfaces = LinkedHashMap.class.getInterfaces(); assertEquals(1, interfaces.length); interfaceList = Arrays.asList(interfaces); assertTrue(interfaceList.contains(Map.class)); }

      Attachments

        Activity

          People

            zhoukevin Kevin Zhou
            zhoukevin Kevin Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: