final CachedMethod[] cachedMethods = cachedMethodsList.toArray(new CachedMethod[cachedMethodsList.size()]);
List<GeneratedMetaMethod.DgmMethodRecord> records = new ArrayList<GeneratedMetaMethod.DgmMethodRecord> ();
for (int i = 0, cur = 0; i < cachedMethods.length; i++) {
CachedMethod method = cachedMethods[i];
if (!method.isStatic() || !method.isPublic())
continue;
if (method.getCachedMethod().getAnnotation(Deprecated.class) != null)
continue;
if (method.getParameterTypes().length == 0)
continue;
final Class returnType = method.getReturnType();
final String className = "org/codehaus/groovy/runtime/dgm$" + cur;
GeneratedMetaMethod.DgmMethodRecord record = new GeneratedMetaMethod.DgmMethodRecord ();
records.add(record);
record.methodName = method.getName();
record.returnType = method.getReturnType();
record.parameters = method.getNativeParameterTypes();
record.className = className;
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
cw.visit(V1_3,ACC_PUBLIC, className,null,"org/codehaus/groovy/reflection/GeneratedMetaMethod", null);
createConstructor(cw);
final String methodDescriptor = BytecodeHelper.getMethodDescriptor(returnType, method.getNativeParameterTypes());
createInvokeMethod(method, cw, returnType, methodDescriptor);
createDoMethodInvokeMethod(method, cw, className, returnType, methodDescriptor);