projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use all parameters for equality.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
data
/
Post.java
diff --git
a/src/main/java/net/pterodactylus/sone/data/Post.java
b/src/main/java/net/pterodactylus/sone/data/Post.java
index
a42cfaa
..
15992a3
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/Post.java
+++ b/
src/main/java/net/pterodactylus/sone/data/Post.java
@@
-17,7
+17,6
@@
package net.pterodactylus.sone.data;
package net.pterodactylus.sone.data;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@
-136,7
+135,7
@@
public class Post {
*
* @return All replies to this post
*/
*
* @return All replies to this post
*/
- public
Collection
<Reply> getReplies() {
+ public
Set
<Reply> getReplies() {
return Collections.unmodifiableSet(replies);
}
return Collections.unmodifiableSet(replies);
}
@@
-174,7
+173,7
@@
public class Post {
*/
@Override
public int hashCode() {
*/
@Override
public int hashCode() {
- return id.hashCode();
+ return id.hashCode()
^ sone.hashCode() ^ (int) (time >> 32) ^ (int) (time & 0xffffffff) ^ text.hashCode()
;
}
/**
}
/**
@@
-185,7
+184,8
@@
public class Post {
if (!(object instanceof Post)) {
return false;
}
if (!(object instanceof Post)) {
return false;
}
- return ((Post) object).id.equals(id);
+ Post post = (Post) object;
+ return post.id.equals(id) && post.sone.equals(sone) && (post.time == time) && post.text.equals(text);
}
}
}
}