Skip to content

api: update Status equals&hashCode#11953

Closed
JoeCqupt wants to merge 1 commit intogrpc:masterfrom
JoeCqupt:fix-status
Closed

api: update Status equals&hashCode#11953
JoeCqupt wants to merge 1 commit intogrpc:masterfrom
JoeCqupt:fix-status

Conversation

@JoeCqupt
Copy link
Copy Markdown
Contributor

@JoeCqupt JoeCqupt commented Mar 10, 2025

@JoeCqupt JoeCqupt changed the title update Status equals&hashCode api: update Status equals&hashCode Mar 10, 2025
@JoeCqupt
Copy link
Copy Markdown
Contributor Author

PTAL @kannanjgithub

@Override
public boolean equals(Object obj) {
return super.equals(obj);
public boolean equals(Object o) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment suggests to just do comparison on the status code as the description and cause are unlikely to be stable. It may be better to do any handling of the comparison logic at the caller site, i.e., StatusOr.equals in this case. Also whether that comparison should just consider the status code or all 3 fields is another question. I will schedule this for discussion in our next week's API review meeting.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are fine with just updating the documentation for StatusOr.equals, which has been done in #12036. Hence closing this PR.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants