Skip to content

Use static final constants for common zero length arrays #23340

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

Closed
philwebb opened this issue Jul 23, 2019 · 0 comments
Closed

Use static final constants for common zero length arrays #23340

philwebb opened this issue Jul 23, 2019 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task
Milestone

Comments

@philwebb
Copy link
Member

There are a few places (most notably in *Utils classes) where we often return zero length arrays. It might be beneficial if instead of returning a new instance for each of these calls, we instead use a shared static final constant.

@philwebb philwebb self-assigned this Jul 23, 2019
@philwebb philwebb added this to the 5.2 RC1 milestone Jul 23, 2019
@philwebb philwebb added in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task labels Jul 23, 2019
philwebb added a commit to philwebb/spring-framework that referenced this issue Jul 23, 2019
Update code that's often called so that zero length array results use
a single shared static constant, rather than a new instance for each
call.

Closes spring-projectsgh-23340
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: task A general task
Projects
None yet
Development

No branches or pull requests

1 participant