Conversation
- Moved it from additional overrides in DefinitionImpl and UsageImpl to postProcess in DefinitionAdapter and UsageAdapter.
- Moved it from additional override UsageImpl to "transform" in UsageAdapter.
martynaslelevicius
approved these changes
Jun 25, 2025
ujhelyiz
approved these changes
Jun 25, 2025
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.
An end usage is automatically considered to be constant if it may time vary. However, while
isConstant()returned true for such elements in memory, the valueisConstant = truewas not being serialized to XMI for them. Similarly, theisAbstractproperty was not being serialized for variation definitions and usages, even thoughisAbstract()returns true for them.The underlying problem is that the automatic setting of
isConstantandisAbstractwas bing done by overriding the methodsisConstant()inUsageImplandisAbstractinDefinitionImplandUsageImpl. In both case, the corresponding the field actually retained its default value. During XMI serialization, theeIsSetoperation is used to check if a field is set. Unfortunately, the generated implementation for this for bothisConstantandisAbstractdirectly checks the field against the default value. These fields are thus treated as having the default value and not serialized.This PR fixes the problem as follows.
isConstant()has been removed fromUsageImpl. Instead, inUsageAdapter::transform, theisConstantproperty is explicitly set to true if the usage is an end and it may time vary. (Note that this cannot be done inpostProcess, because the computation ofmayTimeVaryrequires traversing the specializations of the usage, which cannot be properly done during parse post-processing.isAbstract()have been removed fromDefinitionImplandUsageImpl. InsteadDefinitionAdapter::postProcessandUsageAdapter::postProcesshave been updated to explicitly setisAbstractto true ifisVariationis true.