Browse Source
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-31342pull/31346/head
3 changed files with 17 additions and 1 deletions
Loading…
Reference in new issue