You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
com.googlecode.aviator.exception.ExpressionSyntaxErrorException: Syntax error: unexpect token ']', maybe forget to insert ';' to complete last expression at 5, lineNumber: 1, token : [type='Char',lexeme=']',index=5],
while parsing expression: `
a.b[0]^^^
`
at com.googlecode.aviator.AviatorEvaluatorInstance.innerCompile(AviatorEvaluatorInstance.java:1545) ~[aviator-5.3.3.jar:na]
at com.googlecode.aviator.AviatorEvaluatorInstance.compile(AviatorEvaluatorInstance.java:1506) ~[aviator-5.3.3.jar:na]
at com.googlecode.aviator.AviatorEvaluatorInstance.compile(AviatorEvaluatorInstance.java:1464) ~[aviator-5.3.3.jar:na]
at com.googlecode.aviator.AviatorEvaluatorInstance.compile(AviatorEvaluatorInstance.java:1451) ~[aviator-5.3.3.jar:na]
at com.googlecode.aviator.AviatorEvaluatorInstance.execute(AviatorEvaluatorInstance.java:1668) ~[aviator-5.3.3.jar:na]
at com.googlecode.aviator.AviatorEvaluatorInstance.execute(AviatorEvaluatorInstance.java:1685) ~[aviator-5.3.3.jar:na]
at com.googlecode.aviator.AviatorEvaluator.execute(AviatorEvaluator.java:544) ~[aviator-5.3.3.jar:na]
at movee.aviator.AviatorApplication.lambda$test$0(AviatorApplication.java:79) ~[classes/:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:771) ~[spring-boot-3.1.2.jar:3.1.2]
... 5 common frames omitted
将表达式改为[]访问属性,才会正常:
Object value = AviatorEvaluator.execute("a.b[0].['x']", jsonObj.toMap());
请问上述现象符合设计初衷吗?是否可以优化一下,list元素的属性也可以通过 . 访问?
The text was updated successfully, but these errors were encountered:
我有一个代码片段:
执行时会报错:
将表达式改为[]访问属性,才会正常:
请问上述现象符合设计初衷吗?是否可以优化一下,list元素的属性也可以通过 . 访问?
The text was updated successfully, but these errors were encountered: