Fix equality and hashcode of CancelServerStreamCommand. (#11785)

In e036b1b198, CancelServerStreamCommand got another field. But, its hashCode and equals methods were not updated.
This commit is contained in:
Benjamin Peterson 2025-01-03 10:42:42 -08:00 committed by GitHub
parent b272f634c1
commit bac8b32043
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -69,13 +69,14 @@ final class CancelServerStreamCommand extends WriteQueue.AbstractQueuedCommand {
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
@ -83,6 +84,7 @@ final class CancelServerStreamCommand extends WriteQueue.AbstractQueuedCommand {
return MoreObjects.toStringHelper(this)
.add("stream", stream)
.add("reason", reason)
.add("peerNotify", peerNotify)
.toString();
}