private void initObjectSetupCollection(final ObjectAdapter objectAdapter, final ObjectData data, final ObjectAssociation field) {
/*
* The internal collection is already a part of the object, and
* therefore cannot be recreated, but its oid must be set
*/
final ListOfRootOid refs = (ListOfRootOid) data.get(field.getId());
final ObjectAdapter collectionAdapter = field.get(objectAdapter);
if (!collectionAdapter.canTransitionToResolving()) {
return;
}
try {
PersistorUtil.startResolving(collectionAdapter);
final int size = refs == null ? 0 : refs.size();
final ObjectAdapter[] elements = new ObjectAdapter[size];
for (int j = 0; j < size; j++) {
final RootOid elementOid = refs.elementAt(j);
ObjectAdapter adapter;
adapter = getAdapterManager().getAdapterFor(elementOid);
if (adapter == null) {
adapter = loadInstanceAndAdapt(elementOid);
}