Skip to content

Commit

Permalink
Fix equality and hashcode of CancelServerStreamCommand. (#11785)
Browse files Browse the repository at this point in the history
In e036b1b, CancelServerStreamCommand got another field. But, its hashCode and equals methods were not updated.
  • Loading branch information
benjaminp authored Jan 3, 2025
1 parent b272f63 commit bac8b32
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,22 @@ public boolean equals(Object o) {

CancelServerStreamCommand that = (CancelServerStreamCommand) o;

return Objects.equal(this.stream, that.stream)
&& Objects.equal(this.reason, that.reason);
return this.stream.equals(that.stream)
&& this.reason.equals(that.reason)
&& this.peerNotify.equals(that.peerNotify);
}

@Override
public int hashCode() {
return Objects.hashCode(stream, reason);
return Objects.hashCode(stream, reason, peerNotify);
}

@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("stream", stream)
.add("reason", reason)
.add("peerNotify", peerNotify)
.toString();
}

Expand Down

0 comments on commit bac8b32

Please sign in to comment.