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

Suggest making a Set.size() > 0 judgement for AbstractApplicationContext.earlyApplicationEvents #25161

Closed
luohaoGit opened this issue May 29, 2020 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@luohaoGit
Copy link

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 29, 2020
@jhoeller jhoeller changed the title Suggest making a Set.size() > 0 judgement Suggest making a Set.size() > 0 judgement for AbstractApplicationContext.earlyApplicationEvents May 29, 2020
@jhoeller jhoeller self-assigned this May 29, 2020
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 29, 2020
@jhoeller jhoeller added this to the 5.2.7 milestone May 29, 2020
@jhoeller
Copy link
Contributor

Well spotted! Since we have such emptiness checks in other places already, in particular in hotspot code paths and for collections that tend to be empty at runtime, I've applied our common CollectionUtils.isEmpty check here as well now. While it won't make much difference performance-wise, it does avoid allocation of an Iterator which is generally worthwhile in such scenarios.

FelixFly pushed a commit to FelixFly/spring-framework that referenced this issue Aug 16, 2020
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) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants