Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
BEGIN LICENSE BLOCK ***** Version: CPL 1.0/GPL 2.0/LGPL 2.1 The contents of this file are subject to the Common Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.eclipse.org/legal/cpl-v10.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Alternatively, the contents of this file may be used under the terms of either of the GNU General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the LGPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of either the GPL or the LGPL, and not to allow others to use your version of this file under the terms of the CPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL or the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the CPL, the GPL or the LGPL. END LICENSE BLOCK ***
  
  package org.jruby.internal.runtime.methods;
  
  import org.jruby.Ruby;
  
  public abstract class JavaMethod extends DynamicMethod implements Cloneable {
      protected int arityValue;
      protected Arity arity = .;
      private String javaName;
      private boolean isSingleton;
      protected StaticScope staticScope;
  
      public static final Class[][] METHODS = {
          {nullJavaMethodOne.classJavaMethodOneOrTwo.classJavaMethodOneOrTwoOrThree.class},
          {nullnullJavaMethodTwo.classJavaMethodTwoOrThree.class},
          {nullnullnullJavaMethodThree.class},
      };
  
      public static final Class[][] REST_METHODS = {
          {nullJavaMethodOneOrN.classJavaMethodOneOrTwoOrN.classJavaMethodOneOrTwoOrThreeOrN.class},
          {nullnullJavaMethodTwoOrN.classJavaMethodTwoOrThreeOrN.class},
          {nullnullnullJavaMethodThreeOrN.class},
      };
  
      public static final Class[][] BLOCK_METHODS = {
          {nullJavaMethodOneBlock.classJavaMethodOneOrTwoBlock.classJavaMethodOneOrTwoOrThreeBlock.class},
          {nullnullJavaMethodTwoBlock.classJavaMethodTwoOrThreeBlock.class},
          {nullnullnullJavaMethodThreeBlock.class},
      };
  
      public static final Class[][] BLOCK_REST_METHODS = {
          {nullnullJavaMethodTwoOrNBlock.classJavaMethodTwoOrThreeOrNBlock.class},
          {nullnullnullJavaMethodThreeOrNBlock.class},
      };
  
      
      public JavaMethod(RubyModule implementationClassVisibility visibility) {
          this(implementationClassvisibility.);
      }
  
      public JavaMethod(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
          super(implementationClassvisibilitycallConfig);
      }
      
      public JavaMethod(RubyModule implementationClassVisibility visibilityCallConfiguration callConfigString name) {
          super(implementationClassvisibilitycallConfigname);
      }
      
      protected JavaMethod() {}
      
      public void init(RubyModule implementationClassArity arityVisibility visibilityStaticScope staticScopeCallConfiguration callConfig) {
          this. = staticScope;
          this. = arity;
          this. = arity.getValue();
          super.init(implementationClassvisibilitycallConfig);
      }
      
      public DynamicMethod dup() {
          try {
              JavaMethod msm = (JavaMethod)clone();
             return msm;
         } catch (CloneNotSupportedException cnse) {
             return null;
         }
     }
 
     protected final void preFrameAndScope(ThreadContext contextIRubyObject selfString nameBlock block) {
         context.preMethodFrameAndScope(nameselfblock);
     }
     
     protected final void preFrameAndDummyScope(ThreadContext contextIRubyObject selfString nameBlock block) {
         context.preMethodFrameAndDummyScope(nameselfblock);
     }
     
     protected final void preFrameOnly(ThreadContext contextIRubyObject selfString nameBlock block) {
         context.preMethodFrameOnly(nameselfblock);
     }
     
     protected final void preScopeOnly(ThreadContext context) {
     }
 
     protected final void preNoFrameDummyScope(ThreadContext context) {
     }
     
     protected final void preBacktraceOnly(ThreadContext contextString name) {
         context.preMethodBacktraceOnly(name);
     }
 
     protected final void preBacktraceDummyScope(ThreadContext contextString name) {
     }
     
     protected final void preBacktraceAndScope(ThreadContext contextString name) {
     }
 
     protected final void preNoop() {}
     
     protected final static void postFrameAndScope(ThreadContext context) {
         context.postMethodFrameAndScope();
     }
     
     protected final static void postFrameOnly(ThreadContext context) {
         context.postMethodFrameOnly();
     }
     
     protected final static void postScopeOnly(ThreadContext context) {
         context.postMethodScopeOnly();
     }
 
     protected final static void postNoFrameDummyScope(ThreadContext context) {
         context.postMethodScopeOnly();
     }
     
     protected final static void postBacktraceOnly(ThreadContext context) {
         context.postMethodBacktraceOnly();
     }
 
     protected final static void postBacktraceDummyScope(ThreadContext context) {
         context.postMethodBacktraceDummyScope();
     }
     
     protected final static void postBacktraceAndScope(ThreadContext context) {
         context.postMethodBacktraceAndScope();
     }
 
     protected final static void postNoop(ThreadContext context) {}
     
     protected final void callTrace(ThreadContext contextboolean enabledString name) {
         if (enabledcontext.trace(.namegetImplementationClass());
     }
     
     protected final void returnTrace(ThreadContext contextboolean enabledString name) {
         if (enabledcontext.trace(.namegetImplementationClass());
     }
 
     protected final void callTraceCompiled(ThreadContext contextboolean enabledString nameString fileint line) {
         if (enabledcontext.trace(.namegetImplementationClass(), fileline);
     }
 
     protected final void returnTraceCompiled(ThreadContext contextboolean enabledString name) {
         if (enabledcontext.trace(.namegetImplementationClass());
     }
     
     public void setArity(Arity arity) {
         this. = arity;
         this. = arity.getValue();
     }
 
     @Override
     public Arity getArity() {
         return ;
     }
     
     public void setJavaName(String javaName) {
         this. = javaName;
     }
     
     public String getJavaName() {
         return ;
     }
     
     public void setSingleton(boolean isSingleton) {
         this. = isSingleton;
     }
     
     public boolean isSingleton() {
         return ;
     }
     
     @Override
     public boolean isNative() {
         return true;
     }
 
     public StaticScope getStaticScope() {
         return ;
     }
 
     protected static IRubyObject raiseArgumentError(JavaMethod methodThreadContext contextString nameint givenint minint max) {
         try {
             method.preBacktraceOnly(contextname);
             Arity.raiseArgumentError(context.runtimenamegivenminmax);
         } finally {
             postBacktraceOnly(context);
         }
         // never reached
         return context.runtime.getNil();
     }
 
     protected static void checkArgumentCount(JavaMethod methodThreadContext contextString nameIRubyObject[] argsint num) {
         if (args.length != numraiseArgumentError(methodcontextnameargs.lengthnumnum);
     }
 
     // promise to implement N with block
     public static abstract class JavaMethodNBlock extends JavaMethod {
         public JavaMethodNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
         public JavaMethodNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfigString name) {
             super(implementationClassvisibilitycallConfigname);
         }
     }
 
 
     // promise to implement zero to N with block
     public static abstract class JavaMethodZeroOrNBlock extends JavaMethodNBlock {
         public JavaMethodZeroOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString name) {
             return call(contextselfclazzname.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameBlock block);
     }
 
     public static abstract class JavaMethodZeroOrOneOrNBlock extends JavaMethodZeroOrNBlock {
         public JavaMethodZeroOrOneOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrOneOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0) {
             return call(contextselfclazznamearg0.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject argBlock block);
     }
 
     public static abstract class JavaMethodZeroOrOneOrTwoOrNBlock extends JavaMethodZeroOrOneOrNBlock {
         public JavaMethodZeroOrOneOrTwoOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrOneOrTwoOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1) {
             return call(contextselfclazznamearg0arg1.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1Block block);
     }
 
     public static abstract class JavaMethodZeroOrOneOrTwoOrThreeOrNBlock extends JavaMethodZeroOrOneOrTwoOrNBlock {
         public JavaMethodZeroOrOneOrTwoOrThreeOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrOneOrTwoOrThreeOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2) {
             return call(contextselfclazznamearg0arg1arg2.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2Block block);
     }
 
 
     // promise to implement one to N with block
     public static abstract class JavaMethodOneOrNBlock extends JavaMethodNBlock {
         public JavaMethodOneOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodOneOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0) {
             return call(contextselfclazznamearg0.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject argBlock block);
     }
 
     public static abstract class JavaMethodOneOrTwoOrNBlock extends JavaMethodOneOrNBlock {
         public JavaMethodOneOrTwoOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodOneOrTwoOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1) {
             return call(contextselfclazznamearg0arg1.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1Block block);
     }
 
     public static abstract class JavaMethodOneOrTwoOrThreeOrNBlock extends JavaMethodOneOrTwoOrNBlock {
         public JavaMethodOneOrTwoOrThreeOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodOneOrTwoOrThreeOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2) {
             return call(contextselfclazznamearg0arg1arg2.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2Block block);
     }
 
 
     // promise to implement two to N with block
     public static abstract class JavaMethodTwoOrNBlock extends JavaMethodNBlock {
         public JavaMethodTwoOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodTwoOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1) {
             return call(contextselfclazznamearg0arg1.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1Block block);
     }
 
     public static abstract class JavaMethodTwoOrThreeOrNBlock extends JavaMethodTwoOrNBlock {
         public JavaMethodTwoOrThreeOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodTwoOrThreeOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2) {
             return call(contextselfclazznamearg0arg1arg2.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg1IRubyObject arg2IRubyObject arg3Block block);
     }
 
 
     // promise to implement three to N with block
     public static abstract class JavaMethodThreeOrNBlock extends JavaMethodNBlock {
         public JavaMethodThreeOrNBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodThreeOrNBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2) {
             return call(contextselfclazznamearg0arg1arg2.);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg1IRubyObject arg2IRubyObject arg3Block block);
     }
 
 
     // promise to implement zero to three with block
     public static abstract class JavaMethodZeroBlock extends JavaMethodZeroOrNBlock {
         public JavaMethodZeroBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             if (args.length != 0) return raiseArgumentError(thiscontextnameargs.length, 0, 0);
             return call(contextselfclazznameblock);
         }
     }
 
     public static abstract class JavaMethodZeroOrOneBlock extends JavaMethodZeroOrOneOrNBlock {
         public JavaMethodZeroOrOneBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrOneBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             switch (args.length) {
             case 0:
                 return call(contextselfclazznameblock);
             case 1:
                 return call(contextselfclazznameargs[0], block);
             default:
                 return raiseArgumentError(thiscontextnameargs.length, 0, 1);
             }
         }
     }
 
     public static abstract class JavaMethodZeroOrOneOrTwoBlock extends JavaMethodZeroOrOneOrTwoOrNBlock {
         public JavaMethodZeroOrOneOrTwoBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrOneOrTwoBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             switch (args.length) {
             case 0:
                 return call(contextselfclazznameblock);
             case 1:
                 return call(contextselfclazznameargs[0], block);
             case 2:
                 return call(contextselfclazznameargs[0], args[1], block);
             default:
                 return raiseArgumentError(thiscontextnameargs.length, 0, 2);
             }
         }
     }
 
     public static abstract class JavaMethodZeroOrOneOrTwoOrThreeBlock extends JavaMethodZeroOrOneOrTwoOrThreeOrNBlock {
         public JavaMethodZeroOrOneOrTwoOrThreeBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrOneOrTwoOrThreeBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             switch (args.length) {
             case 0:
                 return call(contextselfclazznameblock);
             case 1:
                 return call(contextselfclazznameargs[0], block);
             case 2:
                 return call(contextselfclazznameargs[0], args[1], block);
             case 3:
                 return call(contextselfclazznameargs[0], args[1], args[2], block);
             default:
                 return raiseArgumentError(thiscontextnameargs.length, 0, 3);
             }
         }
     }
 
     // promise to implement one to three with block
     public static abstract class JavaMethodOneBlock extends JavaMethodOneOrNBlock {
         public JavaMethodOneBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodOneBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             if (args.length != 1) return raiseArgumentError(thiscontextnameargs.length, 1, 1);
             return call(contextselfclazznameargs[0], block);
         }
 
         @Override
         public Arity getArity() {
             return .;
         }
     }
 
     public static abstract class JavaMethodOneOrTwoBlock extends JavaMethodOneOrTwoOrNBlock {
         public JavaMethodOneOrTwoBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodOneOrTwoBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             switch (args.length) {
             case 1:
                 return call(contextselfclazznameargs[0], block);
             case 2:
                 return call(contextselfclazznameargs[0], args[1], block);
             default:
                 return raiseArgumentError(thiscontextnameargs.length, 1, 2);
             }
         }
     }
 
     public static abstract class JavaMethodOneOrTwoOrThreeBlock extends JavaMethodOneOrTwoOrThreeOrNBlock {
         public JavaMethodOneOrTwoOrThreeBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodOneOrTwoOrThreeBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             switch (args.length) {
             case 0:
                 throw context.runtime.newArgumentError(0, 1);
             case 1: return call(contextselfclazznameargs[0], block);
             case 2: return call(contextselfclazznameargs[0], args[1], block);
             case 3: return call(contextselfclazznameargs[0], args[1], args[2], block);
             defaultreturn raiseArgumentError(thiscontextnameargs.length, 3, 3);
             }
         }
     }
 
 
     // promise to implement two to three with block
     public static abstract class JavaMethodTwoBlock extends JavaMethodTwoOrNBlock {
         public JavaMethodTwoBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodTwoBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             if (args.length != 2) return raiseArgumentError(thiscontextnameargs.length, 2, 2);
             return call(contextselfclazznameargs[0], args[1], block);
         }
     }
 
     public static abstract class JavaMethodTwoOrThreeBlock extends JavaMethodTwoOrThreeOrNBlock {
         public JavaMethodTwoOrThreeBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodTwoOrThreeBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             switch (args.length) {
             case 2:
                 return call(contextselfclazznameargs[0], args[1], block);
             case 3:
                 return call(contextselfclazznameargs[0], args[1], args[2], block);
             default:
                 return raiseArgumentError(thiscontextnameargs.length, 2, 3);
             }
         }
     }
 
 
     // promise to implement three with block
     public static abstract class JavaMethodThreeBlock extends JavaMethodThreeOrNBlock {
         public JavaMethodThreeBlock(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodThreeBlock(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             if (args.length != 3) return raiseArgumentError(thiscontextnameargs.length, 3, 3);
             return call(contextselfclazznameargs[0], args[1], args[2], block);
         }
     }
 
     // promise to implement N
     public static abstract class JavaMethodN extends JavaMethodNBlock {
         public JavaMethodN(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
         public JavaMethodN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfigString name) {
             super(implementationClassvisibilitycallConfigname);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] args);
 
         // Normally we could leave these to fall back on the superclass, but
         // since it dispatches through the [] version below, which may
         // dispatch through the []+block version, we can save it a couple hops
         // by overriding these here.
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameBlock block) {
             return call(contextselfclazzname.);
         }
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0Block block) {
             return call(contextselfclazznamenew IRubyObject[] {arg0});
         }
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1Block block) {
             return call(contextselfclazznamenew IRubyObject[] {arg0arg1});
         }
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2Block block) {
             return call(contextselfclazznamenew IRubyObject[] {arg0arg1arg2});
         }
 
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject[] argsBlock block) {
             return call(contextselfclazznameargs);
         }
     }
 
 
     // promise to implement zero to N
     public static abstract class JavaMethodZeroOrN extends JavaMethodN {
         public JavaMethodZeroOrN(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
         public JavaMethodZeroOrN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfigString name) {
             super(implementationClassvisibilitycallConfigname);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameBlock block) {
             return call(contextselfclazzname);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString name);
     }
 
     public static abstract class JavaMethodZeroOrOneOrN extends JavaMethodZeroOrN {
         public JavaMethodZeroOrOneOrN(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrOneOrN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
         
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0Block block) {
             return call(contextselfclazznamearg0);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg);
     }
 
     public static abstract class JavaMethodZeroOrOneOrTwoOrN extends JavaMethodZeroOrOneOrN {
         public JavaMethodZeroOrOneOrTwoOrN(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrOneOrTwoOrN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1Block block) {
             return call(contextselfclazznamearg0arg1);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1);
     }
 
     public static abstract class JavaMethodZeroOrOneOrTwoOrThreeOrN extends JavaMethodZeroOrOneOrTwoOrN {
         public JavaMethodZeroOrOneOrTwoOrThreeOrN(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodZeroOrOneOrTwoOrThreeOrN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2Block block) {
             return call(contextselfclazznamearg0arg1arg2);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2);
     }
 
 
     // promise to implement one to N
     public static abstract class JavaMethodOneOrN extends JavaMethodN {
         public JavaMethodOneOrN(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodOneOrN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
         public JavaMethodOneOrN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfigString name) {
             super(implementationClassvisibilitycallConfigname);
         }
         
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0Block block) {
             return call(contextselfclazznamearg0);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0);
     }
 
     public static abstract class JavaMethodOneOrTwoOrN extends JavaMethodOneOrN {
         public JavaMethodOneOrTwoOrN(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodOneOrTwoOrN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1Block block) {
             return call(contextselfclazznamearg0arg1);
         }
 
         @Override
         public abstract IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1);
     }
 
     public static abstract class JavaMethodOneOrTwoOrThreeOrN extends JavaMethodOneOrTwoOrN {
         public JavaMethodOneOrTwoOrThreeOrN(RubyModule implementationClassVisibility visibility) {
             super(implementationClassvisibility);
         }
         public JavaMethodOneOrTwoOrThreeOrN(RubyModule implementationClassVisibility visibilityCallConfiguration callConfig) {
             super(implementationClassvisibilitycallConfig);
         }
 
         @Override
         public IRubyObject call(ThreadContext contextIRubyObject selfRubyModule clazzString nameIRubyObject arg0IRubyObject arg1IRubyObject arg2Block block) {
             return call(contextselfclazznamearg0arg1arg2);
         }
 
         @Override
         public abstract IRubyObject