Skip to content

Revise AbstractBeanDefinition equals implementation#24048

Merged
sbrannen merged 1 commit into
spring-projects:masterfrom
chenqimiao:feature/polishing
Nov 21, 2019
Merged

Revise AbstractBeanDefinition equals implementation#24048
sbrannen merged 1 commit into
spring-projects:masterfrom
chenqimiao:feature/polishing

Conversation

@chenqimiao

Copy link
Copy Markdown
Contributor

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);

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 21, 2019
@sbrannen sbrannen self-assigned this Nov 21, 2019
@sbrannen sbrannen added type: task A general task in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels 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
@sbrannen

Copy link
Copy Markdown
Member

This has been merged into master.

Thanks

@jhoeller

Copy link
Copy Markdown
Contributor

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 A general bug and removed type: task A general 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
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.1.x labels Nov 21, 2019
jhoeller added a commit that referenced this pull request Nov 21, 2019
@dreis2211

dreis2211 commented Nov 21, 2019

Copy link
Copy Markdown
Contributor

I wonder if that makes a performance difference 🤔

@chenqimiao chenqimiao deleted the feature/polishing branch November 22, 2019 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants