Skip to content

Commit bac8b32

Browse files
authored
Fix equality and hashcode of CancelServerStreamCommand. (grpc#11785)
In e036b1b, CancelServerStreamCommand got another field. But, its hashCode and equals methods were not updated.
1 parent b272f63 commit bac8b32

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

netty/src/main/java/io/grpc/netty/CancelServerStreamCommand.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,22 @@ public boolean equals(Object o) {
6969

7070
CancelServerStreamCommand that = (CancelServerStreamCommand) o;
7171

72-
return Objects.equal(this.stream, that.stream)
73-
&& Objects.equal(this.reason, that.reason);
72+
return this.stream.equals(that.stream)
73+
&& this.reason.equals(that.reason)
74+
&& this.peerNotify.equals(that.peerNotify);
7475
}
7576

7677
@Override
7778
public int hashCode() {
78-
return Objects.hashCode(stream, reason);
79+
return Objects.hashCode(stream, reason, peerNotify);
7980
}
8081

8182
@Override
8283
public String toString() {
8384
return MoreObjects.toStringHelper(this)
8485
.add("stream", stream)
8586
.add("reason", reason)
87+
.add("peerNotify", peerNotify)
8688
.toString();
8789
}
8890

0 commit comments

Comments
 (0)