Skip to content
Snippets Groups Projects
Commit 695a37f1 authored by Simon Barner's avatar Simon Barner
Browse files

Ensure that IDs have been assigned to all new model elements before they are...

Ensure that IDs have been assigned to all new model elements before they are hooked to the project / resource
- Rationale
  - Model elements for which no ID has been assigned, have id 0 (which is the default value). 
  - When the new element is hooked to the resource, ResourceUtils.KernelResourceFactory.KernelXMIResource.getId() is called, which internally calls setId() to synchronize the XMI ID with the AF3 ID. In case the ID is still 0, this implicit call will corrupt the ID -> model object map (by override the mapping for key 0).
- Changes
  - ElementCompositorService: Assign IDs *before* hooking new element to the container (but of course using the container to determine the next free ID)
  - ModelElementCompositorBase: Assign IDs to newly instantiated annotations
parent 56e8cae3
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment