ic.getArity().getValue(), method0.getName(), Modifier.isStatic(method0.getModifiers()),
ic.getArity().getValue(), method0.getName(), Modifier.isStatic(method0.getModifiers()),
/** * Use reflection to provide a method handle based on an annotated Java * method. * * @see org.jruby.internal.runtime.methods.MethodFactory#getAnnotatedMethod */ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMethodDescriptor desc) { try { if (!Modifier.isPublic(desc.getDeclaringClass().getModifiers())) { LOG.warn("warning: binding non-public class {}; reflected handles won't work", desc.declaringClassName); } Method method = desc.getDeclaringClass().getDeclaredMethod(desc.name, desc.getParameterClasses()); JavaMethod ic = new ReflectedJavaMethod(implementationClass, method, desc.anno); TypePopulator.populateMethod( ic, ic.getArity().getValue(), method.getName(), Modifier.isStatic(method.getModifiers()), CallConfiguration.getCallConfigByAnno(desc.anno), desc.anno.notImplemented()); return ic; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Use reflection to provide a method handle based on an annotated Java * method. * * @see org.jruby.internal.runtime.methods.MethodFactory#getAnnotatedMethod */ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMethodDescriptor desc) { try { if (!Modifier.isPublic(desc.getDeclaringClass().getModifiers())) { LOG.warn("warning: binding non-public class {}; reflected handles won't work", desc.declaringClassName); } Method method = desc.getDeclaringClass().getDeclaredMethod(desc.name, desc.getParameterClasses()); JavaMethod ic = new ReflectedJavaMethod(implementationClass, method, desc.anno); TypePopulator.populateMethod( ic, ic.getArity().getValue(), method.getName(), Modifier.isStatic(method.getModifiers()), CallConfiguration.getCallConfigByAnno(desc.anno), desc.anno.notImplemented()); return ic; } catch (Exception e) { throw new RuntimeException(e); } }