Retain null-safe syntax in AST representation of SpEL indexers

Prior to this commit, SpEL's CompoundExpression omitted the null-safe
syntax in AST string representations of indexing operations.

To address this, this commit implements isNullSafe() in Indexer.

See gh-29847
This commit is contained in:
Sam Brannen
2024-03-22 17:41:14 +01:00
parent 4d433174eb
commit d2bd0d5716
2 changed files with 11 additions and 2 deletions

View File

@@ -60,8 +60,8 @@ class ParsingTests {
parseCheck("property1?.property2?.methodOne()");
parseCheck("property1?.methodOne('enigma')?.methodTwo(42)");
parseCheck("property1?.methodOne()?.property2?.methodTwo()");
parseCheck("property1[0]?.property2['key']?.methodTwo()");
parseCheck("property1[0][1]?.property2['key'][42]?.methodTwo()");
parseCheck("property1?.[0]?.property2?.['key']?.methodTwo()");
parseCheck("property1?.[0]?.[1]?.property2?.['key']?.[42]?.methodTwo()");
}
@Test