Extend SuperEqualsIsObjectEquals to cover hashCode, renaming it to "SuperCallToObjectMethod."#4155
Closed
copybara-service[bot] wants to merge 1 commit into
Closed
Extend SuperEqualsIsObjectEquals to cover hashCode, renaming it to "SuperCallToObjectMethod."#4155copybara-service[bot] wants to merge 1 commit into
SuperEqualsIsObjectEquals to cover hashCode, renaming it to "SuperCallToObjectMethod."#4155copybara-service[bot] wants to merge 1 commit into
Conversation
…o "`SuperCallToObjectMethod`." ...as suggested by @Marcono1234 in #4147 (comment). Also, add docs. PiperOrigin-RevId: 574501701
f9ac970 to
fb06f25
Compare
Stephan202
reviewed
Oct 19, 2023
| if (obj instanceof Foo) { | ||
| return super.equals(obj) && id == ((Foo) obj).id; | ||
| } | ||
| return obj; |
Contributor
There was a problem hiding this comment.
Suggested change
| return obj; | |
| return false; |
| if (obj instanceof Foo) { | ||
| return id == ((Foo) obj).id; | ||
| } | ||
| return obj; |
Contributor
There was a problem hiding this comment.
Suggested change
| return obj; | |
| return false; |
| } | ||
| return id.equals(((Foo) obj).id); | ||
| } | ||
| return obj; |
Contributor
There was a problem hiding this comment.
Suggested change
| return obj; | |
| return false; |
copybara-service Bot
pushed a commit
that referenced
this pull request
Oct 19, 2023
(pointed out [by @Stephan202](#4155 (comment))) PiperOrigin-RevId: 574976916
Merged
copybara-service Bot
pushed a commit
that referenced
this pull request
Oct 19, 2023
(pointed out [by @Stephan202](#4155 (comment))) PiperOrigin-RevId: 575004527
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend
SuperEqualsIsObjectEqualsto coverhashCode, renaming it to "SuperCallToObjectMethod."...as suggested by @Marcono1234 in #4147 (comment).
Also, add docs.