Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend SuperEqualsIsObjectEquals to cover hashCode, renaming it to "SuperCallToObjectMethod." #4155

Closed
wants to merge 1 commit into from

Conversation

copybara-service[bot]
Copy link
Contributor

Extend SuperEqualsIsObjectEquals to cover hashCode, renaming it to "SuperCallToObjectMethod."

...as suggested by @Marcono1234 in #4147 (comment).

Also, add docs.

…o "`SuperCallToObjectMethod`."

...as suggested by @Marcono1234 in #4147 (comment).

Also, add docs.

PiperOrigin-RevId: 574501701
if (obj instanceof Foo) {
return super.equals(obj) && id == ((Foo) obj).id;
}
return obj;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return obj;
return false;

if (obj instanceof Foo) {
return id == ((Foo) obj).id;
}
return obj;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return obj;
return false;

}
return id.equals(((Foo) obj).id);
}
return obj;
Copy link
Contributor

Choose a reason for hiding this comment

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

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
@copybara-service copybara-service bot mentioned this pull request Oct 19, 2023
copybara-service bot pushed a commit that referenced this pull request Oct 19, 2023
(pointed out [by @Stephan202](#4155 (comment)))

PiperOrigin-RevId: 575004527
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants