From: David ‘Bombe’ Roden Date: Thu, 14 Oct 2010 10:35:43 +0000 (+0200) Subject: Use all parameters for equality. X-Git-Tag: 0.1-RC1~401 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8bc55daff94063bc5cb6b1d240e408aac836f82b;p=Sone.git Use all parameters for equality. --- 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); } }