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

Improve names of classes generated by the SpEL compiler #32497

Closed
sbrannen opened this issue Mar 20, 2024 · 3 comments
Closed

Improve names of classes generated by the SpEL compiler #32497

sbrannen opened this issue Mar 20, 2024 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

Overview

After making this #29548 (comment), I decided it's worthwhile to improve the names of classes generated by the SpEL compiler in any case.

Status Quo

The SpEL compiler currently generates classes in a package named spel with names following the pattern Ex#, where # is an index starting with 2 (which was simply an oversight).

This results in class names such as:

  • spel.Ex2
  • spel.Ex3
  • etc.

Goal

Generate classes in a package named org.springframework.expression.spel.generated with names following the pattern CompiledExpression#####, where ##### is a 0-padded counter starting with 00001.

This results in class names such as:

  • org.springframework.expression.spel.generated.CompiledExpression00001
  • org.springframework.expression.spel.generated.CompiledExpression00002
  • etc.

Related Issues

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Mar 20, 2024
@sbrannen sbrannen added this to the 6.2.0-M1 milestone Mar 20, 2024
@sbrannen sbrannen self-assigned this Mar 20, 2024
@jdomigon
Copy link

Another interesting use case for us, would be, allowing to customize the package inside the spel code is generated.
This would allow us to access using spel to package-private fields in some situations.

@sbrannen
Copy link
Member Author

This would allow us to access using spel to package-private fields in some situations.

@jdomigon, if you have valid use cases for accessing fields or methods which are currently package-private, please open a new issue (or issues) to discuss that separately.

@sbrannen
Copy link
Member Author

Another interesting use case for us, would be, allowing to customize the package inside the spel code is generated.

That is a likely outcome of #29548 since it would need to be configurable for AOT support.

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

2 participants