Index: src/java/org/datanucleus/state/JDOStateManagerImpl.java =================================================================== --- src/java/org/datanucleus/state/JDOStateManagerImpl.java (revision 2063) +++ src/java/org/datanucleus/state/JDOStateManagerImpl.java (working copy) @@ -362,7 +362,7 @@ pcCopy.jdoCopyFields(myPC, getAllFieldNumbers()); // Swap the managed PC to be the copy and not the input - pcCopy.jdoReplaceStateManager(this); + replaceStateManager(pcCopy, this); myPC = pcCopy; disconnectClone((PersistenceCapable)pc); } @@ -548,7 +548,7 @@ this.myLC = myOM.getOMFContext().getApiAdapter().getLifeCycleState(LifeCycleState.DETACHED_CLEAN); this.myPC.jdoReplaceFlags(); - myPC.jdoReplaceStateManager(this); + replaceStateManager(this); } /** @@ -565,7 +565,7 @@ { loadedFields[i] = true; } - myPC.jdoReplaceStateManager(this); + replaceStateManager(this); } /** @@ -685,7 +685,7 @@ new CachePopulateFieldManager(this, getSecondClassMutableFields(), myFP, state, cachedPC)); // Disconnect the StateManager - ((PersistenceCapable)cachePC).jdoReplaceStateManager(null); + replaceStateManager(((PersistenceCapable)cachePC), null); return cachePC; } @@ -897,8 +897,8 @@ } // Swap the StateManager on the objects - pc.jdoReplaceStateManager(this); - myPC.jdoReplaceStateManager(null); + replaceStateManager(pc, this); + replaceStateManager(null); // Swap our object myPC = pc; @@ -924,11 +924,11 @@ } // Assign the new object to this StateManager temporarily so that we can copy its fields - pc.jdoReplaceStateManager(this); + replaceStateManager(pc, this); myPC.jdoCopyFields(pc, fieldNumbers); // Remove the StateManager from the other object - pc.jdoReplaceStateManager(null); + replaceStateManager(pc, null); // Set the loaded flags now that we have copied for (int i=0;i