SpelExpressionParser throws IllegalStateException instead of ParseException for invalid expression #31097
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: regression
A bug that is also a regression
Milestone
Environment Details
Spring Framework Version: 6.0.6
Spring Boot Version: 3.0.4
Java Version: 17
Description
According to the Spring documentation, invoking parseExpression on a SpelExpressionParser should only result in a ParseException when provided with an invalid expression. However, in practice, it throws an IllegalStateException with the message "No node".
Steps to Reproduce
Test Code
Expected Behavior
The test should pass, with ParseException being thrown for the invalid expression.
Actual Behavior
The test fails with the following output:
The text was updated successfully, but these errors were encountered: