what is functionality going as follwing
Class c = Class.forName(handler);
Class partypes[] = new Class[1];
partypes[0] = new String().getClass();
Constructor ct = c.getConstructor(partypes);
Object arglist1[] = new Object[1];
arglist1[0] = address;
Method meth[] = c.getMethods();
Object arglist[] = new Object[7];
arglist[0] = new Integer(transid);
arglist[1] = transobj;
arglist[2] = data_vec;
arglist[3] = company_name;
arglist[4] = new Boolean(flag_final_level_approval);
flag_final_level_approval=true else false
arglist[5] = con;
arglist[6] = scon;
boolean found = false;
for(int i=0;i<meth.length;i++) {
Method m = meth[i];
if(m.getName().equals(functionName)) {
result_vec = (Vector)m.invoke(ct.newInstance(arglist1),arglist);
}
}
Someone is using some heinous reflection to call methods on the
handlerclass.I’d be curious to know why all the arguments being put so laboriously into that array of arguments couldn’t have been passed to a handler instance and simply called.
It looks like someone decided to go with a complex implementation to satisfy a (real or imagined) requirement for ultimate flexibility.