if(methods[i]!=null) {
Class[] parameterTypes = methods[i].getParameterTypes();
for(int y=0;y<parameterTypes.length;y++) {
if(toReferenceClass(parameterTypes[y])!=clazzArgs[y]) continue outer;
}
return new MethodInstance(methods[i],args);
}
}
// like comparsion
//MethodInstance mi=null;
// print.e("like:"+methodName);
outer:for(int i=0;i<methods.length;i++) {
if(methods[i]!=null) {
Class[] parameterTypes = methods[i].getParameterTypes();
for(int y=0;y<parameterTypes.length;y++) {
if(!like(clazzArgs[y],toReferenceClass(parameterTypes[y]))) continue outer;
}
return new MethodInstance(methods[i],args);
}
}
// convert comparsion
// print.e("convert:"+methodName);
MethodInstance mi=null;
int _rating=0;
outer:for(int i=0;i<methods.length;i++) {
if(methods[i]!=null) {
RefInteger rating=(methods.length>1)?new RefIntegerImpl(0):null;
Class[] parameterTypes = methods[i].getParameterTypes();
Object[] newArgs = new Object[args.length];
for(int y=0;y<parameterTypes.length;y++) {
try {
newArgs[y]=convert(args[y],toReferenceClass(parameterTypes[y]),rating);
} catch (PageException e) {
continue outer;
}
}
if(mi==null || rating.toInt()>_rating) {
if(rating!=null)_rating=rating.toInt();
mi=new MethodInstance(methods[i],newArgs);
}
//return new MethodInstance(methods[i],newArgs);
}
}return mi;
}