copyReference(eReference, eObject, copyEObject);
}
}
else if (FeatureMapUtil.isFeatureMap(eStructuralFeature))
{
FeatureMap featureMap = (FeatureMap)eObject.eGet(eStructuralFeature);
FeatureMap copyFeatureMap = (FeatureMap)copyEObject.eGet(getTarget(eStructuralFeature));
int copyFeatureMapSize = copyFeatureMap.size();
for (int k = 0, featureMapSize = featureMap.size(); k < featureMapSize; ++k)
{
EStructuralFeature feature = featureMap.getEStructuralFeature(k);
if (feature instanceof EReference)
{
Object referencedEObject = featureMap.getValue(k);
Object copyReferencedEObject = get(referencedEObject);
if (copyReferencedEObject == null && referencedEObject != null)
{
EReference reference = (EReference)feature;
if (!useOriginalReferences || reference.isContainment() || reference.getEOpposite() != null)
{
continue;
}
copyReferencedEObject = referencedEObject;
}
// If we can't add it, it must aleady be in the list so find it and move it to the end.
//
if (!copyFeatureMap.add(feature, copyReferencedEObject))
{
for (int l = 0; l < copyFeatureMapSize; ++l)
{
if (copyFeatureMap.getEStructuralFeature(l) == feature && copyFeatureMap.getValue(l) == copyReferencedEObject)
{
copyFeatureMap.move(copyFeatureMap.size() - 1, l);
--copyFeatureMapSize;
break;
}
}
}
}
else
{
copyFeatureMap.add(featureMap.get(k));
}
}
}
}
}