Skip to content

Comments

ST6RI-850 Generating XMI with implicit elements can cause an exception#651

Merged
seidewitz merged 3 commits intomasterfrom
ST6RI-850
May 19, 2025
Merged

ST6RI-850 Generating XMI with implicit elements can cause an exception#651
seidewitz merged 3 commits intomasterfrom
ST6RI-850

Conversation

@seidewitz
Copy link
Member

This PR corrects a bug that can cause an exception when a model is saved to XMI with implicit elements.

In the Beta 3 version of the KerML Specification, the checkFeatureValueBindingConnector constraint was updated so that the implied BindingConnector for a FeatureValue is between the featureWithValue and a feature chain consisting of the value Expression and the result of that Expression (where previously it had been directly to the result). This was implemented in the 2025-02 release (see change to FeatureAdapter in PR #638). The target feature chain of the implied BindingConnector should have been owned by the ReferenceSubsetting relating it to the appropriate connectorEnd. Unfortunately, the implementation did not do this, so the owning Feature for the feature chain ended up not being contained in the resource being saved to XMI, which can cause the exception.

This PR fixes the bug by adding a check to ConnectorUtil::addConnectorEnd of whether the given relatedElement has an owner. If not, the relatedElement is added as an ownedRelatedElement of the ReferenceSubsetting of the connectorEnd being created.

- If the relatedFeature has no owner, then it is added as an
ownedRelatedElement of the reference subsetting on the connector end.
@seidewitz seidewitz added this to the 2025-04 milestone May 16, 2025
@seidewitz seidewitz self-assigned this May 16, 2025
seidewitz added 2 commits May 16, 2025 17:12
Checks if TransitionUsage succession is null before creating an implicit
binding connector to it. A TransitionUsage should always have a
nested succession, but this avoids an NPE if the usage is ill-formed.
- FeatureAdapter::getBoundValueResult
- TypeAdapter::addResultBinding
@seidewitz seidewitz merged commit 6c752f6 into master May 19, 2025
2 checks passed
@seidewitz seidewitz added the bug Something isn't working label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants