Do not precede indexed access with a dot in SpEL AST representation
Prior to this commit, if a Spring Expression Language (SpEL) expression
contained indexed access to an object, the generated AST String
representation incorrectly included a dot ('.') before the index access.
For example, 'property[0]' had a generated AST string representation of
'property.[0]'.
This commit addresses this by reworking the logic in
CompoundExpression.toStringAST().
Closes gh-30610
This commit is contained in:
@@ -43,6 +43,12 @@ class ParsingTests {
|
||||
@Nested
|
||||
class Miscellaneous {
|
||||
|
||||
@Test
|
||||
void compoundExpressions() {
|
||||
parseCheck("property1.property2.methodOne()");
|
||||
parseCheck("property1[0].property2['key'].methodOne()");
|
||||
}
|
||||
|
||||
@Test
|
||||
void supportedCharactersInIdentifiers() {
|
||||
parseCheck("#var='value'");
|
||||
|
||||
Reference in New Issue
Block a user