Optimize InlineMap and InlineList in SpEL

- Make InlineList#constant and InlineMap#constant final.

- Add more assertions for InlineMap tests.

Closes gh-30251
This commit is contained in:
Harry Yang
2023-03-31 13:09:15 +08:00
committed by Sam Brannen
parent baf367831f
commit 0e0c298dcf
3 changed files with 62 additions and 60 deletions

View File

@@ -117,6 +117,9 @@ public class MapTests extends AbstractExpressionTests {
checkConstantMap("{#root.name:true}",false);
checkConstantMap("{a:1,b:2,c:{d:true,e:false}}", true);
checkConstantMap("{a:1,b:2,c:{d:{1,2,3},e:{4,5,6},f:{'a','b','c'}}}", true);
// for nested InlineMap
checkConstantMap("{a:{k:#d}}", false);
checkConstantMap("{@bean:@bean}", false);
}
private void checkConstantMap(String expressionText, boolean expectedToBeConstant) {