Skip to content

SpEL's CompoundExpression.toStringAST() incorrectly includes . for indexed properties #30610

New issue

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

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

Already on GitHub? # to your account

Closed
sbrannen opened this issue Jun 7, 2023 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Jun 7, 2023

I discovered this bug while writing tests for gh-30580.

parseCheck("begrüssung[1]", "begrüssung.[1]"); // extra "." is needed due to erroneous logic in CompoundExpression.toStringAST()

Essentially, an expression like property1[0].property2['key'].methodOne() should have an identical AST string representation; whereas, the current AST string representation is property1.[0].property2.['key'].methodOne() with a . preceding every indexed property access.

@sbrannen sbrannen added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) labels Jun 7, 2023
@sbrannen sbrannen added this to the 6.0.10 milestone Jun 7, 2023
@sbrannen sbrannen self-assigned this Jun 7, 2023
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jun 7, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant