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

Revise AbstractBeanDefinition equals implementation #24048

Merged
merged 1 commit into from Nov 21, 2019

Conversation

@chenqimiao
Copy link
Contributor

chenqimiao commented Nov 21, 2019

The following way of writing seems a bit redundant

rtn = rtn &= ObjectUtils.nullSafeEquals(this.scope, that.scope);

I think we can polish it by writing the following.

rtn &= ObjectUtils.nullSafeEquals(this.scope, that.scope);
@sbrannen sbrannen self-assigned this Nov 21, 2019
@sbrannen sbrannen changed the title Polishing Polish AbstractBeanDefinition Nov 21, 2019
@sbrannen sbrannen merged commit bb2e3ce into spring-projects:master Nov 21, 2019
1 check passed
1 check passed
ci/pivotal-cla Thank you for signing the Contributor License Agreement!
Details
@sbrannen

This comment has been minimized.

Copy link
Member

sbrannen commented Nov 21, 2019

This has been merged into master.

Thanks

@jhoeller

This comment has been minimized.

Copy link
Contributor

jhoeller commented Nov 21, 2019

Actually, this wasn't intending to use & to begin with, rather && with its short-circuiting of the right-hand side if the left-hand side is false already. I'll update this accordingly, also backporting it to 5.1.x.

@jhoeller jhoeller assigned jhoeller and unassigned sbrannen Nov 21, 2019
@jhoeller jhoeller added type: bug and removed type: task labels Nov 21, 2019
@jhoeller jhoeller added this to the 5.2.2 milestone Nov 21, 2019
@jhoeller jhoeller changed the title Polish AbstractBeanDefinition Restore short-circuiting in AbstractBeanDefinition equals implementation Nov 21, 2019
@jhoeller jhoeller changed the title Restore short-circuiting in AbstractBeanDefinition equals implementation Revise AbstractBeanDefinition equals implementation Nov 21, 2019
jhoeller added a commit that referenced this pull request Nov 21, 2019
jhoeller added a commit that referenced this pull request Nov 21, 2019
@dreis2211

This comment has been minimized.

Copy link
Contributor

dreis2211 commented Nov 21, 2019

I wonder if that makes a performance difference 🤔

@chenqimiao chenqimiao deleted the chenqimiao:feature/polishing branch Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.