From 8bc55daff94063bc5cb6b1d240e408aac836f82b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 14 Oct 2010 12:35:43 +0200 Subject: [PATCH] Use all parameters for equality. --- src/main/java/net/pterodactylus/sone/data/Reply.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/data/Reply.java b/src/main/java/net/pterodactylus/sone/data/Reply.java index cfc6d91..44aaf89 100644 --- a/src/main/java/net/pterodactylus/sone/data/Reply.java +++ b/src/main/java/net/pterodactylus/sone/data/Reply.java @@ -152,7 +152,7 @@ public class Reply { */ @Override public int hashCode() { - return post.hashCode() ^ id.hashCode(); + return sone.hashCode() ^ id.hashCode() ^ post.hashCode() ^ (int) (time >> 32) ^ (int) (time & 0xffffffff); } /** @@ -163,7 +163,8 @@ public class Reply { if (!(object instanceof Reply)) { return false; } - return ((Reply) object).post.equals(post) && ((Reply) object).id.equals(id); + Reply reply = (Reply) object; + return reply.sone.equals(sone) && reply.id.equals(id) && reply.post.equals(post) && (reply.time == time) && reply.text.equals(text); } } -- 2.7.4