The EmfModel class currently implements getElementId by returning the URI fragment of the given eObject. This can be problematic with models that span multiple EMF resources, as the URI fragment is only unique within that particular resource:
EmfModel m = /* ... */;
EObject eob = /* ... */;
String id = m.getElementId(eob);
// Could return an element from another resource with the same URI fragment!
EObject eob2 = m.getElementById(id);
We should change the behaviour of getElementId and related methods (getElementById) so they return and receive full EObject URIs in models with more than one resource. This should limit the impact on previously existing code, while also correcting the problem for EmfModels with more than one Resource in their ResourceSet.
The EmfModel class currently implements
getElementIdby returning the URI fragment of the given eObject. This can be problematic with models that span multiple EMF resources, as the URI fragment is only unique within that particular resource:We should change the behaviour of getElementId and related methods (getElementById) so they return and receive full EObject URIs in models with more than one resource. This should limit the impact on previously existing code, while also correcting the problem for
EmfModels with more than one Resource in their ResourceSet.