private T matchVarArgsCallableArityTwo(IRubyObject self, IRubyObject arg0, IRubyObject arg1) { final T[] varArgsCallables = this.javaVarargsCallables; if ( varArgsCallables != null ) { T callable = CallableSelector.matchingCallableArityTwo(runtime, this, varArgsCallables, arg0, arg1); if ( callable == null ) { throw newErrorDueArgumentTypeMismatch(self, varArgsCallables, arg0, arg1); } return callable; } return null; }
private T matchVarArgsCallableArityTwo(IRubyObject self, IRubyObject arg0, IRubyObject arg1) { final T[] varArgsCallables = this.javaVarargsCallables; if ( varArgsCallables != null ) { T callable = CallableSelector.matchingCallableArityTwo(runtime, this, varArgsCallables, arg0, arg1); if ( callable == null ) { throw newErrorDueArgumentTypeMismatch(self, varArgsCallables, arg0, arg1); } return callable; } return null; }
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; }
protected JavaCallable findCallableArityTwo(IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1) { JavaCallable callable; if ((callable = javaCallable) == null) { // TODO: varargs? JavaCallable[] callablesForArity = null; if (javaCallables.length <= 2 || (callablesForArity = javaCallables[2]) == null) { throw self.getRuntime().newArgumentError(2, javaCallables.length - 1); } callable = CallableSelector.matchingCallableArityTwo(runtime, cache, callablesForArity, arg0, arg1); if (callable == null) { throw CallableSelector.argTypesDoNotMatch(self.getRuntime(), self, callablesForArity, arg0, arg1); } } else { if (callable.getParameterTypes().length != 2) { throw self.getRuntime().newArgumentError(2, callable.getParameterTypes().length); } } return callable; }
protected JavaCallable findCallableArityTwo(IRubyObject self, String name, IRubyObject arg0, IRubyObject arg1) { JavaCallable callable; if ((callable = javaCallable) == null) { // TODO: varargs? JavaCallable[] callablesForArity = null; if (javaCallables.length <= 2 || (callablesForArity = javaCallables[2]) == null) { throw self.getRuntime().newArgumentError(2, javaCallables.length - 1); } callable = CallableSelector.matchingCallableArityTwo(runtime, cache, callablesForArity, arg0, arg1); if (callable == null) { throw CallableSelector.argTypesDoNotMatch(self.getRuntime(), self, callablesForArity, arg0, arg1); } } else { if (callable.getParameterTypes().length != 2) { throw self.getRuntime().newArgumentError(2, callable.getParameterTypes().length); } } return callable; }