-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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 negative repeated text count in SpEL
Due to the changes in gh-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 gh-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, this commit improves diagnostics for a negative repeated text count in SpEL expressions by throwing a SpelEvaluationException with a new NEGATIVE_REPEATED_TEXT_COUNT error message. Closes gh-31342
- Loading branch information
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters