name = detachField.getName();
declarer = detachField.getDeclaringClass().getName();
}
// public Object pcGetDetachedState ()
BCMethod method = _pc.declareMethod(PRE + "GetDetachedState",
Object.class, null);
method.setStatic(false);
method.makePublic();
int access = method.getAccessFlags();
Code code = method.getCode(true);
if (impl) {
// return pcDetachedState;
loadManagedInstance(code, false);
getfield(code, _managedType.getProject().loadClass(declarer),
name);
} else
code.constant().setNull();
code.areturn();
code.calculateMaxLocals();
code.calculateMaxStack();
// public void pcSetDetachedState (Object state)
method = _pc.declareMethod(PRE + "SetDetachedState",
void.class, new Class []{ Object.class });
method.setAccessFlags(access);
code = method.getCode(true);
if (impl) {
// pcDetachedState = state;
loadManagedInstance(code, false);
code.aload().setParam(0);
putfield(code, _managedType.getProject().loadClass(declarer),