From: David ‘Bombe’ Roden Date: Fri, 1 Apr 2011 10:35:17 +0000 (+0200) Subject: Override hashCode() and equals() with calls to superclasses. X-Git-Tag: 0.6^2~28 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=3febaf7f2deaf775a8ec4fb34dd43c5c7927f653;p=Sone.git Override hashCode() and equals() with calls to superclasses. This has been noticed by FindBugs. --- diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java b/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java index ab96756..eade03e 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultOwnIdentity.java @@ -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); + } + }