-
Notifications
You must be signed in to change notification settings - Fork 898
Open
Description
public static void main(String[] args) {
boolean result = (boolean) AviatorEvaluator.execute("user != nil && user.id > book.id && (nil + 1 > 3)");
System.out.println(result);
}希望短路并返回false,但是抛了异常:
Exception in thread "main" com.googlecode.aviator.exception.ExpressionRuntimeException: Could not add <Nil, null> with <Long, 1>
at com.googlecode.aviator.runtime.type.AviatorObject.add(AviatorObject.java:153)
at com.googlecode.aviator.runtime.type.AviatorNil.add(AviatorNil.java:51)
at com.googlecode.aviator.lexer.token.OperatorType.eval(OperatorType.java:108)
at com.googlecode.aviator.runtime.op.OperationRuntime.eval0(OperationRuntime.java:57)
at com.googlecode.aviator.runtime.op.OperationRuntime.eval(OperationRuntime.java:47)
at com.googlecode.aviator.code.OptimizeCodeGenerator.executeOperator(OptimizeCodeGenerator.java:221)
at com.googlecode.aviator.code.OptimizeCodeGenerator.execute(OptimizeCodeGenerator.java:158)
at com.googlecode.aviator.code.OptimizeCodeGenerator.getResult(OptimizeCodeGenerator.java:361)
qiangbro
Metadata
Metadata
Assignees
Labels
No labels