NamespaceSet: update_nss_from() on V30RC01 does not update Qualifiers and Extensions correctly
This issue is only relevant for the V30RC01 branch.
In the current version of the improve/V30RC01-branch, the
update_nss_from() method of NamespaceSets does not consider Qualifiers and Extensions correctly. If a Referable object with Qualifiers or Extensions is updated from another Referable object, only new and deleted Qualifiers/Extensions will be updated, whereas changed Qualifiers/Extensions are not updated. This is due to the missing code in
base.py near line 1477: https://git.rwth-aachen.de/acplt/pyi40aas/-/blob/6711a5bb3f9d951e59d3c4311600b1b5a6413bd1/aas/model/base.py#L1477
Since Qualifiers and Extensions are not Referable and thus have no
update_from() method, we cannot update them recursively. Instead, we should just replace the old objects with the new ones. In fact, this simplyfies the whole
update_nss_from() behaviour: We don't have to divide into new, deleted and update Qualifiers/Extensions, but instead, we can simply remove all of these objects from
self and move all of the ones from
self. Thus, I propose to add a high-level
if statement, that checks if the NamespaceSet uses the
id_short attribute for identification: If it does, we can use the old behaviour of
update_nss_from() (we don't even need to check the type of the objects), if not, we should use the simplified updating (deleting and moving).