Closed himi closed 7 months ago
I quickly dealt with your change request. (But I have not checked it well)
I think I could make relevant changes. I'll check it further later.
I verified that the latest update fixes the bugs in the models in which I had previously found it:
1a-Parts Tree
3a-Function-based Behavior-1
SysML v2 Spec Annex A SimpleVehicleModel
This seems sufficient for the current release.
Ed,thank you for the review.
The changes made in PR #552 resulted in uses of the
%viz
command in the Jupyter environment to sometimes throw aConcurrentModificationException
. This happens when traversing theownedRelationships
of an element. If the traversal enters into a library model, it is possible (after PR #552) that implicit specialization processing will cause the "on demand" insertion of new elements into the abstract syntax tree in a small number of cases (result parameter for an expression, subject for a requirement or case, objective for a case). If this happens, a newownedRelationship
is added (for the membership of the new element), which can cause theConcurrentModificationException
.This PR resolves the problem by adding utility methods that create arrays for those lists for which direct iteration may be unsafe, and revises the traversal code to use those utilities instead of directly iterating over the unsafe lists.