Skip to content

[EMF] EmfModel only returns resource-scoped element IDs #216

@agarciadom

Description

@agarciadom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions