Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve diagnostics for repeated text size overflow in SpEL
If the resulting size of repeated text in a SpEL expression (using the repeat operator '*') would exceed MAX_REPEATED_TEXT_SIZE, we currently throw a SpelEvaluationException with the MAX_REPEATED_TEXT_SIZE_EXCEEDED message. However, if the calculation of the repeated text size results in integer overflow, our max size check fails to detect that, and String#repeat(int) throws a preemptive OutOfMemoryError from which the application immediately recovers. To improve diagnostics for users, this commit ensures that we consistently throw a SpelEvaluationException with the MAX_REPEATED_TEXT_SIZE_EXCEEDED message when integer overflow occurs. Closes gh-31341
- Loading branch information