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

EL1072 when evaluating compiled expression using method SpelExpression.getValue(Object rootObject, Class<T> expectedResultType) [SPR-17229] #21762

Closed
spring-projects-issues opened this issue Aug 30, 2018 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Juan Domínguez González opened SPR-17229 and commented

When using method SpelExpression.getValue(Object rootObject, Class<T> expectedResultType) for evaluating an expression involving a simple boolean comparison it fails when using the bytecode compiled expression.

The trace shows a NPE in Operator.equalityCheck, accesing the evaluation context for a typeComparator:

org.springframework.expression.spel.ast.Operator.equalityCheck(Operator.java:222)

spel.Ex2141.getValue(Unknown Source)

org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:209)

The problem, apparently resides in method SpelExpression.getValue(Object, Class<T>). In line 209, it calls method getValue(Object, EvaluationContext) on its compiledAst but passes null instead of an evaluation context.


Affects: 4.3.16

Referenced from: commits 51cee65, e332e32, 1a626ab

Backported to: 4.3.19

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've revised SpelExpression to consistently expose a default EvaluationContext to the compiled AST. Also, Operator includes explicit support for Boolean comparisons now.

@spring-projects-issues spring-projects-issues added type: bug A general bug status: backported An issue that has been backported to maintenance branches in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.0.9 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants