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

Lazily initialize DataSize.PATTERN #28560

Closed
sbrannen opened this issue Jun 3, 2022 · 1 comment
Closed

Lazily initialize DataSize.PATTERN #28560

sbrannen opened this issue Jun 3, 2022 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Jun 3, 2022

To avoid unnecessary eager initialization of org.springframework.util.unit.DataSize.PATTERN, we should initialize it lazily in the first invocation of DataSize.parse(CharSequence, DataUnit).

This can be achieved by moving PATTERN to a private static nested class.

See oracle/graal#4489 for details.

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Jun 3, 2022
@sbrannen sbrannen added this to the 5.3.21 milestone Jun 3, 2022
@sbrannen sbrannen self-assigned this Jun 3, 2022
@sbrannen
Copy link
Member Author

sbrannen commented Jun 3, 2022

sbrannen added a commit that referenced this issue Jun 3, 2022
In light of gh-28560, this commit reverts the change made in gh-28328.

Closes gh-28562
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

1 participant