in src/main/java/org/apache/commons/jexl3/internal/Interpreter.java [1596:1632]
private Object visit(final ASTMethodNode node, final Object antish, final Object data) {
Object object = antish;
// left contains the reference to the method
final JexlNode methodNode = node.jjtGetChild(0);
Object method;
// 1: determine object and method or functor
if (methodNode instanceof ASTIdentifierAccess) {
method = methodNode;
if (object == null) {
object = data;
if (object == null) {
// no object, we fail
return node.isSafeLhs(isSafe())
? null
: unsolvableMethod(methodNode, "<null>.<?>(...)");
}
} else {
// edge case of antish var used as functor
method = object;
}
} else {
method = methodNode.jjtAccept(this, data);
}
Object result = method;
for (int a = 1; a < node.jjtGetNumChildren(); ++a) {
if (result == null) {
// no method, we fail// variable unknown in context and not a local
return node.isSafeLhs(isSafe())
? null
: unsolvableMethod(methodNode, "<?>.<null>(...)");
}
final ASTArguments argNode = (ASTArguments) node.jjtGetChild(a);
result = call(node, object, result, argNode);
object = result;
}
return result;
}