Improve diagnostics for negative repeated text count in SpEL #31342
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Due to the changes in #31341, if the repeat count in a SpEL expression (using the repeat operator
*
) is negative, we throw aSpelEvaluationException
with theMAX_REPEATED_TEXT_SIZE_EXCEEDED
message which is incorrect and misleading.Prior to #31341, a negative repeat count resulted in an
IllegalArgumentException
being thrown byString#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.
The text was updated successfully, but these errors were encountered: