Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

spring-projects-issues opened this issue Feb 28, 2018 · 1 comment
in: core type: regression


Copy link

@spring-projects-issues spring-projects-issues commented Feb 28, 2018

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


Issue Links:

  • #20276 Extend null-safety to field level

Referenced from: commits fa670dd

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 1, 2018

Juergen Hoeller commented

This turned out to be an assertion that was set too early. I've moved it to after the null-target check within Indexer.getValueRef where a non-null TypeDescriptor is actually needed.

@spring-projects-issues spring-projects-issues added type: regression in: core labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.0.5 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: core type: regression
None yet

No branches or pull requests

2 participants