private static int createMethod(BytecodeContext statConstr,BytecodeContext constr, java.util.List<LitString> keys,ClassWriter cw,String className, Object member,int max,boolean writeLog, boolean supressWSbeforeArg) throws PageException {
boolean hasOptionalArgs=false;
if(member instanceof UDF) {
UDF udf = (UDF) member;
FunctionArgument[] args = udf.getFunctionArguments();
Type[] types=new Type[max<0?args.length:max];
for(int y=0;y<types.length;y++){
types[y]=toType(args[y].getTypeAsString(),true);//Type.getType(Caster.cfTypeToClass(args[y].getTypeAsString()));
if(!args[y].isRequired())hasOptionalArgs=true;
}
Type rtnType=toType(udf.getReturnTypeAsString(),true);
Method method = new Method(
udf.getFunctionName(),
rtnType,
types
);
GeneratorAdapter adapter = new GeneratorAdapter(Opcodes.ACC_PUBLIC+Opcodes.ACC_FINAL , method, null, null, cw);
BytecodeContext bc = new BytecodeContext(null,statConstr,constr,getPage(statConstr,constr),keys,cw,className,adapter,method,writeLog,supressWSbeforeArg);
Label start=adapter.newLabel();
adapter.visitLabel(start);
//ComponentController.invoke(name, args);
// name
adapter.push(udf.getFunctionName());
// args
ArrayVisitor av=new ArrayVisitor();
av.visitBegin(adapter,Types.OBJECT,types.length);
for(int y=0;y<types.length;y++){