if (mm == null && objects.length > 0) {
Object lastArg = objects[objects.length - 1];
if (lastArg instanceof Closure) {
Class<?>[] at2 = Arrays.copyOf(types, types.length);
at2[objects.length - 1] = Function.class;
mm = metaclass.pickMethod(name, at2);
if (mm != null) {
objects[objects.length - 1] = new ClosureFunction((Closure) lastArg);
}
}
}