protected final T findCallableArityTwo(IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1) { T callable = this.javaCallable; if ( callable == null ) { // TODO: varargs? final T[] callablesForArity; if ( javaCallables.length <= 2 || (callablesForArity = javaCallables[2]) == null ) { if ((callable = matchVarArgsCallableArityTwo(self, arg0, arg1)) == null ) { throw runtime.newArgumentError(2, javaCallables.length - 1); } return callable; } callable = CallableSelector.matchingCallableArityTwo(runtime, this, callablesForArity, arg0, arg1); if ( callable == null ) { if ((callable = matchVarArgsCallableArityTwo(self, arg0, arg1)) == null ) { throw newErrorDueArgumentTypeMismatch(self, callablesForArity, arg0, arg1); } } } else { if (!callable.isVarArgs()) checkCallableArity(callable, 2); } return callable; }
protected final T findCallableArityTwo(IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1) { T callable = this.javaCallable; if ( callable == null ) { // TODO: varargs? final T[] callablesForArity; if ( javaCallables.length <= 2 || (callablesForArity = javaCallables[2]) == null ) { if ((callable = matchVarArgsCallableArityTwo(self, arg0, arg1)) == null ) { throw runtime.newArgumentError(2, javaCallables.length - 1); } return callable; } callable = CallableSelector.matchingCallableArityTwo(runtime, this, callablesForArity, arg0, arg1); if ( callable == null ) { if ((callable = matchVarArgsCallableArityTwo(self, arg0, arg1)) == null ) { throw newErrorDueArgumentTypeMismatch(self, callablesForArity, arg0, arg1); } } } else { if (!callable.isVarArgs()) checkCallableArity(callable, 2); } return callable; }