Author: toad
Date: 2008-04-05 10:31:07 +0000 (Sat, 05 Apr 2008)
New Revision: 19005

Modified:
   trunk/freenet/src/freenet/clients/http/bookmark/Bookmark.java
   trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
Log:
Implement Bookmark.hashCode() and use it in BookmarkItem.hashCode() to include 
name, as we already do in equals() by calling super.

Modified: trunk/freenet/src/freenet/clients/http/bookmark/Bookmark.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/Bookmark.java       
2008-04-05 10:27:30 UTC (rev 19004)
+++ trunk/freenet/src/freenet/clients/http/bookmark/Bookmark.java       
2008-04-05 10:31:07 UTC (rev 19005)
@@ -28,5 +28,9 @@
         }
     }

+    public int hashCode() {
+       return name.hashCode();
+    }
+    
     public abstract SimpleFieldSet getSimpleFieldSet();
 }

Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java   
2008-04-05 10:27:30 UTC (rev 19004)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java   
2008-04-05 10:31:07 UTC (rev 19005)
@@ -171,7 +171,7 @@
     }

        public int hashCode() {
-               int hash = 7;
+               int hash = super.hashCode();
                hash = 31 * hash + this.key.setSuggestedEdition(0).hashCode();
                hash = 31 * hash + (this.hasAnActivelink ? 1 : 0);
                hash = 31 * hash + (this.desc != null ? this.desc.hashCode() : 
0);


Reply via email to