private void copyConstructors(CtClass superclass, CtClass proxy) throws Exception
{
CtConstructor[] ctors = superclass.getConstructors();
int minParameters = Integer.MAX_VALUE;
CtConstructor bestCtor = null;
for (int i = 0 ; i < ctors.length ; i++)
{
CtClass[] params = ctors[i].getParameterTypes();
CtConstructor ctor = CtNewConstructor.make(
ctors[i].getParameterTypes(),
ctors[i].getExceptionTypes(),
CtNewConstructor.PASS_PARAMS,
null,
null,
proxy);
ctor.setModifiers(ctors[i].getModifiers());
proxy.addConstructor(ctor);
if (params.length < minParameters)
{
bestCtor = ctor;