for (int i = 4; i < 4 + numParams; i++) {
types[i] = Util.getJCRefType(OBJECT_SIG);
names[i] = "param" + String.valueOf(i-4);
}
NamedMethodGenerator methodGen =
new NamedMethodGenerator(ACC_PUBLIC,
com.sun.org.apache.bcel.internal.generic.Type.VOID,
types, names, methodName,
getClassName(), il, cpg);
il.append(template.compile(classGen, methodGen));
il.append(RETURN);
methodGen.stripAttributes(true);
methodGen.setMaxLocals();
methodGen.setMaxStack();
methodGen.removeNOPs();
classGen.addMethod(methodGen.getMethod());
}