// now calculate the parameters
int offset = 1;
for (Class<?> aClass : delegatedMethod.getParameterTypes())
{
final Type type = Type.getType(aClass);
mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), offset);
offset += type.getSize();
}
// and finally invoke the target method on the provided Contextual Instance
final Type declaringClass = Type.getType(delegatedMethod.getDeclaringClass());
if (abstractMethod)
{
// generate an empty return block
}
else
{
// invoke the method on the super class;
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor, false);
}
generateReturn(mv, delegatedMethod);
mv.visitMaxs(-1, -1);