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 diagnostics for negative repeated text count in SpEL #31342

Closed
sbrannen opened this issue Sep 29, 2023 · 0 comments
Closed

Improve diagnostics for negative repeated text count in SpEL #31342

sbrannen opened this issue Sep 29, 2023 · 0 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

Due to the changes in #31341, if the repeat count in a SpEL expression (using the repeat operator *) is negative, we throw a SpelEvaluationException with the MAX_REPEATED_TEXT_SIZE_EXCEEDED message which is incorrect and misleading.

Prior to #31341, a negative repeat count resulted in an IllegalArgumentException being thrown by String#repeat(), which was acceptable in terms of diagnostics, but that did not make it immediately clear to the user what the underlying cause was.

In light of the above, we should improve diagnostics for a negative repeated text count in SpEL expressions.

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Sep 29, 2023
@sbrannen sbrannen added this to the 6.0.13 milestone Sep 29, 2023
@sbrannen sbrannen self-assigned this Sep 29, 2023
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