Merged
Conversation
Use Xtext node information to preserve explicit isComposite and isReference assignments while restoring implicit parser defaults during post-processing. Keep standard EMF creation and XMI deserialization aligned with the Ecore default by removing constructor-specific isComposite initialization.
UsageImpl silently changes isComposite=false to true after an XMI round-trip
seidewitz
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a bug that caused the
isCompositeproperty of aUsageto always be true when reading from XMI, even if it wasfalsein the XMI. The fix presumes the changes already made in PR #793.Background
UsageImplinitialized the inheritedFeature::isCompositeproperty to true directly in its constructor:This conflicts with the declared Ecore default of the inherited property:
As a result, an explicit
isComposite=falsevalue was silently changed totrueafter saving and reloading the model.This is not only a difference between two default-value conventions. It violates the fundamental persistence invariant:
must preserve the semantic state of model.
Note that this was not a problem for Xtext parsing, because
isCompositecould be set during parsing after aUsageelement was created, if arefkeyword is found or during post-processing. The intent was that theUsageelement would default toisComposite = truein the abstract syntax otherwise, but that the XMI defaultisCompositewould still befalse, as for KerML. As outlined above, however, this does no work for an XMI roundtrip.Changes
The following changes were made following the changes made in PR #793.
org.omg.sysml.xtext.postprocessor.UsageParserPostProcessor, use Xtext node information to preserve explicitisCompositeand isReferenceassignments while restoring implicit parser defaults during post-processing.isCompositeinitialization, restoring standard EMF creation and XMI deserialization aligned with the Ecore default.