Index: src/java/org/apache/nutch/crawl/MapWritable.java
===================================================================
--- src/java/org/apache/nutch/crawl/MapWritable.java	(revision 399480)
+++ src/java/org/apache/nutch/crawl/MapWritable.java	(working copy)
@@ -224,16 +224,19 @@
   public boolean equals(Object obj) {
     if (obj instanceof MapWritable) {
       MapWritable map = (MapWritable) obj;
+      HashSet set1 = new HashSet();
       KeyValueEntry e1 = fFirst;
+      while (e1 != null) {
+        set1.add(e1);
+        e1 = e1.fNextEntry;
+      }
+      HashSet set2 = new HashSet();
       KeyValueEntry e2 = map.fFirst;
-      while (e1 != null && e2 != null) {
-        if (!e1.equals(e2)) {
-          return false;
-        }
-        e1 = e1.fNextEntry;
+      while (e2 != null) {
+        set2.add(e2);
         e2 = e2.fNextEntry;
       }
-      return true;
+      return set1.equals(set2);
     }
     return false;
   }
@@ -452,6 +455,10 @@
       }
       return false;
     }
+
+    public int hashCode() {
+      return toString().hashCode();
+    }
   }
 
   /** container for Id class tuples */
Index: src/test/org/apache/nutch/crawl/TestMapWritable.java
===================================================================
--- src/test/org/apache/nutch/crawl/TestMapWritable.java	(revision 399480)
+++ src/test/org/apache/nutch/crawl/TestMapWritable.java	(working copy)
@@ -91,6 +91,16 @@
     }
     testWritable(c);
   }
+  
+  public void testEquals() {
+    MapWritable map1 = new MapWritable();
+    MapWritable map2 = new MapWritable();
+    map1.put(new UTF8("key1"), new UTF8("val1"));
+    map1.put(new UTF8("key2"), new UTF8("val2"));
+    map2.put(new UTF8("key2"), new UTF8("val2"));
+    map2.put(new UTF8("key1"), new UTF8("val1"));
+    assertTrue(map1.equals(map2));
+  }
 
   public void testPerformance() throws Exception {
     File file = new File(System.getProperty("java.io.tmpdir"), "mapTestFile");
