ST6RI-751 References to result parameters, subject parameters and objectives do not always resolve correctly #552
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.
Currently, there are three cases in which elements are still being physically added to the parse tree (rather than cached in adapters like is done for implicit relationships), when they are not declared explicitly in a model: result parameters for expressions, subject parameters for requirements and cases and objectives for cases. This is not actually called for in the specifications, but is still necessary in order for implied redefinitions to be added correctly in the case of multiple specializations.
For example, in the following model:
subject, objective and result features are added to the parse tree for the analysis case usage
a
. These features implicitly redefine the corresponding featuress
,o
andr
from the analysis case definitionA
. Because of these redefinitions, the references tos
,o
andr
within part usagep
should resolve to the features of the usagea
.This PR fixes a bug that could result in these references incorrectly resolving to the features of the definition
A
when the declaration ofa
is lexically after the declaration ofp
. It also moves utility methods related to subjects and objectives out of classTypeUtil
into the SysML-specific classUsageUtil
.