Override hashCode() and equals() with calls to superclasses.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Apr 2011 10:35:17 +0000 (12:35 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Apr 2011 10:35:17 +0000 (12:35 +0200)
This has been noticed by FindBugs.

src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java

index ab96756..eade03e 100644 (file)
@@ -167,4 +167,20 @@ public class DefaultOwnIdentity extends DefaultIdentity implements OwnIdentity {
                }
        }
 
+       //
+       // OBJECT METHODS
+       //
+
+       @Override
+       public int hashCode() {
+               /* The hash of DefaultIdentity is fine. */
+               return super.hashCode();
+       }
+
+       @Override
+       public boolean equals(Object object) {
+               /* The ID of the superclass is still enough. */
+               return super.equals(object);
+       }
+
 }