final int accessFlags = JDO_PC_jdoPreSerialize_Mods;
final ExceptionsAttribute exceptAttr = null;
// begin of method body
final InsnTarget begin = new InsnTarget();
Insn insn = begin;
// store the sm field into local var
insn = insn.append(Insn.create(opc_aload_0));
insn = insn.append(
Insn.create(
opc_getfield,
getjdoStateManagerFieldRef()));
insn = insn.append(Insn.create(opc_astore_1));
// test the sm field and goto end if null
final InsnTarget end = new InsnTarget();
insn = insn.append(Insn.create(opc_aload_1));
insn = insn.append(Insn.create(opc_ifnull, end));
// call the sm's method with 'this' argument
insn = insn.append(Insn.create(opc_aload_1));
insn = insn.append(Insn.create(opc_aload_0));
insn = insn.append(
new InsnInterfaceInvoke(
pool.addInterfaceMethodRef(
JDO_StateManager_Path,
JDO_SM_preSerialize_Name,
JDO_SM_preSerialize_Sig),
countMethodArgWords(JDO_SM_preSerialize_Sig)));
// end of method body
insn = insn.append(end);
insn = insn.append(Insn.create(opc_return));
final CodeAttribute codeAttr
= new CodeAttribute(getCodeAttributeUtf8(),
2, // maxStack
2, // maxLocals