Class[] parameterTypes = constructors[i].getParameterTypes();
for(int y=0;y<parameterTypes.length;y++) {
if(toReferenceClass(parameterTypes[y])!=clazzArgs[y]) continue outer;
}
return new ConstructorInstance(constructors[i],args);
}
}
// like comparsion
outer:for(int i=0;i<constructors.length;i++) {
if(constructors[i]!=null) {
Class[] parameterTypes = constructors[i].getParameterTypes();
for(int y=0;y<parameterTypes.length;y++) {
if(!like(clazzArgs[y],toReferenceClass(parameterTypes[y]))) continue outer;
}
return new ConstructorInstance(constructors[i],args);
}
}
// convert comparsion
ConstructorInstance ci=null;
int _rating=0;
outer:for(int i=0;i<constructors.length;i++) {
if(constructors[i]!=null) {
RefInteger rating=(constructors.length>1)?new RefIntegerImpl(0):null;
Class[] parameterTypes = constructors[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(ci==null || rating.toInt()>_rating) {
if(rating!=null)_rating=rating.toInt();
ci=new ConstructorInstance(constructors[i],newArgs);
}
//return new ConstructorInstance(constructors[i],newArgs);
}
}
return ci;