return method.invokeDirect(proxy.getObject(), cArg0, cArg1, cArg2);
}
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
if (block.isGiven()) {
JavaProxy proxy = castJavaProxy(self);
int len = args.length;
// these extra arrays are really unfortunate; split some of these paths out to eliminate?
Object[] convertedArgs = new Object[len + 1];
IRubyObject[] intermediate = new IRubyObject[len + 1];
System.arraycopy(args, 0, intermediate, 0, len);
intermediate[len] = RubyProc.newProc(context.runtime, block, block.type);
JavaMethod method = (JavaMethod)findCallable(self, name, intermediate, len + 1);
for (int i = 0; i < len + 1; i++) {
convertedArgs[i] = convertArg(intermediate[i], method, i);
}
return method.invokeDirect(proxy.getObject(), convertedArgs);
} else {
return call(context, self, clazz, name, args);
}
}