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

Updated equals check in equals? #1751

Closed
wants to merge 1 commit into from
Closed

Updated equals check in equals? #1751

wants to merge 1 commit into from

Conversation

capak07
Copy link

@capak07 capak07 commented Apr 9, 2024

@chaoren
Copy link
Member

chaoren commented Apr 9, 2024

I don't think this actually addresses #1633. In fact, this change would probably perform worse than the current implementation. Also, we haven't decided on a resolution to #1633 yet.

Copy link
Member

@eamonnmcmanus eamonnmcmanus left a comment

Choose a reason for hiding this comment

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

I think we would be open to a carefully-constructed PR that implements #1633. This PR in its current state doesn't achieve that, however.

@@ -214,8 +214,16 @@ final class $className implements $annotationName, `java.io.Serializable` {

@`java.lang.Override`
public boolean equals($equalsParameterType o) {
if (o == this) {
return true;
int objectPropertyCount = 0;
Copy link
Member

Choose a reason for hiding this comment

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

This can be done at compile time, so it shouldn't be done at run time.

}

if (objectPropertyCount > 1) {
if (o == this) {
Copy link
Member

Choose a reason for hiding this comment

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

Braces don't match, so apparently this PR has never been tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove o == this check from generated equals?
3 participants