Skip to content

Commit 21b6747

Browse files
Merge pull request #1063 from zsxwing/Timestamped-bug
Fix bugs in equals and hashCode of Timestamped
2 parents a21cf20 + 77e2771 commit 21b6747

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rxjava-core/src/main/java/rx/schedulers/Timestamped.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public boolean equals(Object obj) {
5050
if (this == obj) {
5151
return true;
5252
}
53+
if (obj == null) {
54+
return false;
55+
}
5356
if (!(obj instanceof Timestamped)) {
5457
return false;
5558
}
@@ -71,7 +74,7 @@ public boolean equals(Object obj) {
7174
public int hashCode() {
7275
final int prime = 31;
7376
int result = 1;
74-
result = prime * result + (int) (timestampMillis ^ (timestampMillis));
77+
result = prime * result + (int) (timestampMillis ^ (timestampMillis >>> 32));
7578
result = prime * result + ((value == null) ? 0 : value.hashCode());
7679
return result;
7780
}

0 commit comments

Comments
 (0)