Skip to content

SpEL : Indexed access within an expression with null variables is no longer a SpelEvaluationException [SPR-16544] #21087

Closed
@spring-projects-issues

Description

@spring-projects-issues

DJ Kulkarni opened SPR-16544 and commented

Evaluating a spelExpression which contains indexed access to StandardEvaluationContext variables throws a java.lang.IllegalStateException, when no variables are set.

Previously the exception used to be a friendly SpelEvaluationException with SpelMessage.CANNOT_INDEX_INTO_NULL_VALUE.

See attached a project for testing. Change the springVersion in build.gradle to 4.3.14.RELEASE and the tests are green.

A commit for #20276, specifically in org.springframework.expression.spel.ast.Indexer seems to have introduced the change in behavior.


Affects: 5.0 GA, 5.0.1, 5.0.2, 5.0.3, 5.0.4

Attachments:

Issue Links:

Referenced from: commits fa670dd

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions