harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r538398 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/AbstractMap.java test/java/tests/api/java/util/AbstractMapTest.java
Date Wed, 16 May 2007 01:41:04 GMT
Author: pyang
Date: Tue May 15 18:41:04 2007
New Revision: 538398

URL: http://svn.apache.org/viewvc?view=rev&rev=538398
Log:
Revert patch for HARMONY-3865([classlib][luni] AbstractMap seems to have a flawed equals method),
which causes regression in archive module

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractMapTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java?view=diff&rev=538398&r1=538397&r2=538398
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/AbstractMap.java
Tue May 15 18:41:04 2007
@@ -142,14 +142,9 @@
 
             try {
                 while (it.hasNext()) {
-                    Entry<K, V> entry = it.next();
-                    K key = entry.getKey();
-                    V value = entry.getValue();
-                    Object obj = map.get(key);
-                    if( null != obj ) {
-                            return obj.equals(value);
+                    if (!objectSet.contains(it.next())) {
+                        return false;
                     }
-                    return ( obj == value );
                 }
             } catch (ClassCastException cce) {
                 return false;

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractMapTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractMapTest.java?view=diff&rev=538398&r1=538397&r2=538398
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractMapTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractMapTest.java
Tue May 15 18:41:04 2007
@@ -18,19 +18,15 @@
 package tests.api.java.util;
 
 import java.util.AbstractMap;
-import java.util.AbstractSet;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.IdentityHashMap;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
-import java.util.Vector;
 import java.util.WeakHashMap;
 
 public class AbstractMapTest extends junit.framework.TestCase {
@@ -195,77 +191,6 @@
 		MyMap mapClone = (MyMap) map.clone();
 		assertTrue("clone not shallow", map.getMap() == mapClone.getMap());
 	}
-    
-    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);
-        assertEquals("Should be equal", amt, ht);
-    }
 
 	protected void setUp() {
 	}



Mime
View raw message