PersistentObjectItf spClone = (PersistentObjectItf)clone;
spClone.speedoSetEncodedPName(pm.getEncodedPName(sp));
spClone.setCeAge(0);
spClone.speedoIsActive(false);
//instanciate the clone of the fields
StateItf fieldsClone = sp.speedoCreateState();
spClone.speedoSetReferenceState(fieldsClone);
fieldsClone.setSpeedoPO(spClone);
//put the association between the po and its clone into the map
if(map != null)
map.put(sp, clone);
synchronized(fgHints){
readIntention(sp, null).detachCopy(pm, map, fieldsClone, fgHints);
}
//mark the state as detached
fieldsClone.setDetachedStatus(DetachedLifeCycle.DETACHED_CLEAN);
} catch(Exception e){
throw personality.newUserRuntimeException("Detach cannot be performed", new Exception[]{ExceptionHelper.getNested(e)});
}
}
return (PersistentObjectItf)clone;