public static Object invokeObjectMethod(Object object, String methodName, Object[] args, BshEvaluatingVisitor visitor, SimpleNode callerInfo) throws ReflectError, EvalError, InvocationTargetException {
if (object instanceof This && !This.isExposedThisMethod(methodName)) {
return ((This) object).invokeMethod(methodName, args, visitor.getInterpreter(), visitor.getCallstack(), callerInfo, false);
}
try {
BshClassManager bcm = visitor.getInterpreter() == null ? null : visitor.getInterpreter().getClassManager();
Class clas = object.getClass();
Method method = resolveExpectedJavaMethod(bcm, clas, object, methodName, args, false);
return invokeMethod(method, object, args);
} catch (UtilEvalError e) {
throw e.toEvalError(callerInfo, visitor.getCallstack());
}
}