Skip to content
  • Simon Barner's avatar
    Ensure that IDs have been assigned to all new model elements before they are... · 695a37f1
    Simon Barner authored
    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
    
    695a37f1