* method. Return the resulting generated or loaded class.
*
* @see org.jruby.runtime.MethodFactory#getAnnotatedMethod
*/
public Class getAnnotatedMethodClass(List<JavaMethodDescriptor> descs) throws Exception {
JavaMethodDescriptor desc1 = descs.get(0);
if (!Modifier.isPublic(desc1.getDeclaringClass().getModifiers())) {
LOG.warn("warning: binding non-public class {}; reflected handles won't work", desc1.declaringClassName);
}
String javaMethodName = desc1.name;
if (DEBUG) {
if (descs.size() > 1) {
out.println("Binding multiple: " + desc1.declaringClassName + "." + javaMethodName);
} else {
out.println("Binding single: " + desc1.declaringClassName + "." + javaMethodName);
}
}
String generatedClassName = CodegenUtils.getAnnotatedBindingClassName(javaMethodName, desc1.declaringClassName, desc1.isStatic, desc1.actualRequired, desc1.optional, descs.size() > 1, desc1.anno.frame());
if (RubyInstanceConfig.FULL_TRACE_ENABLED) {
// in debug mode we append _DBG to class name to force it to regenerate (or use pre-generated debug version)
generatedClassName += "_DBG";
}
String generatedClassPath = generatedClassName.replace('.', '/');
DescriptorInfo info = new DescriptorInfo(descs);
Class superclass = determineSuperclass(info);
Class c = tryClass(generatedClassName, desc1.getDeclaringClass(), superclass);
if (c == null) {
synchronized (syncObject) {
// try again
c = tryClass(generatedClassName, desc1.getDeclaringClass(), superclass);
if (c == null) {
if (DEBUG) out.println("Generating " + generatedClassName + ", min: " + info.getMin() + ", max: " + info.getMax() + ", hasBlock: " + info.isBlock() + ", rest: " + info.isRest());
String superClassString = p(superclass);