You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2007/05/16 03:43:16 UTC

[jira] Reopened: (HARMONY-3865) [classlib][luni] AbstractMap seems to have a flawed equals method

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

Paulex Yang reopened HARMONY-3865:
----------------------------------


Reverted at r538398,  the patch caused archive module failure at Linux: 

Error log:
1) test_ConstructorLjava_util_jar_Attributes
junit.framework.AssertionFailedError: equal at
org.apache.harmony.archive.tests.java.util.jar.AttributesTest.test_ConstructorLjava_util_jar_Attributes(AttributesTest.java:48)
at java.lang.reflect.VMReflection.invokeMethod

2) test_clone
junit.framework.AssertionFailedError: equal at
org.apache.harmony.archive.tests.java.util.jar.AttributesTest.test_clone(AttributesTest.java:226)
at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)



> [classlib][luni] AbstractMap seems to have a flawed equals method
> -----------------------------------------------------------------
>
>                 Key: HARMONY-3865
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3865
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: spark shen
>         Assigned To: Paulex Yang
>         Attachments: AbstractMap.patch
>
>
> The following test case will fail on Harmony, but pass on RI
> public class AMT extends AbstractMap {
>         // Very crude AbstractMap implementation
>         Vector values = new Vector();
>         Vector keys = new Vector();
>         public Set entrySet() {
>             return new AbstractSet() {
>                 public Iterator iterator() {
>                     return new Iterator() {
>                         int index = 0;
>                         public boolean hasNext() {
>                             return index < values.size();
>                         }
>                         public Object next() {
>                             if (index < values.size()) {
>                                 Map.Entry me = new Map.Entry() {
>                                     Object v = values.elementAt(index);
>                                     Object k = keys.elementAt(index);
>                                     public Object getKey() {
>                                         return k;
>                                     }
>                                     public Object getValue() {
>                                         return v;
>                                     }
>                                     public Object setValue(Object value) {
>                                         return null;
>                                     }
>                                 };
>                                 index++;
>                                 return me;
>                             }
>                             return null;
>                         }
>                         public void remove() {
>                         }
>                     };
>                 }
>                 public int size() {
>                     return values.size();
>                 }
>             };
>         }
>         public Object put(Object k, Object v) {
>             keys.add(k);
>             values.add(v);
>             return v;
>         }
>     }
>     
>     /**
>      * @tests {@link java.util.AbstractMap#putAll(Map)}
>      */
>     public void test_putAllLMap() {
>         Hashtable ht = new Hashtable();
>         AMT amt = new AMT();
>         ht.put("this", "that");
>         amt.putAll(ht);
>         amt.equals(ht);
>         assertEquals("Should be equal", amt, ht);
>     }

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