From edbcd819855c6dc4d9bbe329120b6adbf6f376ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 12 Jun 2009 21:46:23 +0200 Subject: [PATCH 1/1] Override equals() and hashCode() in Identity. --- .../pterodactylus/fcp/plugin/WebOfTrustPlugin.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java b/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java index f265855..1649ce8 100644 --- a/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java +++ b/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java @@ -489,6 +489,26 @@ public class WebOfTrustPlugin { return requestUri; } + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if ((obj == null) || (obj.getClass() != this.getClass())) { + return false; + } + Identity identity = (Identity) obj; + return identifier.equals(identity.identifier); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return identifier.hashCode(); + } + } /** -- 2.7.4