Use virtual dispatch for declarative property lookup 馃 - #3117
Open
lwrage wants to merge 2 commits into
Open
Conversation
Model declarative property values on a component implementation, subcomponent, feature, and port connection. Assert both the instantiated declarative element kind and cached value so the test exercises every dispatch path without relying on annex behavior.
Move instance-model declarative lookup behind a NamedElement operation, with the generic behavior in NamedElementOperations and specialized overrides on subcomponents, features, and port connections. Remove the caller's instanceof chain and the dead all parameter while preserving the existing lookup order.
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.
Summary
NamedElement.getPropertyValueForInstanceand put the generic behavior inNamedElementOperationsPropertyImpltype-and-cast chain with one virtual callallparameter plumbingRegression coverage
Issue3108Testinstantiates a valid external AADL model with declarative values on a component implementation, subcomponent, feature, and port connection. It asserts both the declarative element kind behind each instance and the property value cached through that lookup path.The test passed at the test-only commit before the refactor and after the production change.
Validation
mvn -o -T5 -s releng/osate.releng/settings.xml -Plocal -pl :org.osate.aadl2,:org.osate.core.tests,:org.osate.core.feature -Dtycho.localArtifacts=default -Dpr.build=true -Dsign=false -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false -Dtest=Issue3108Test -DfailIfNoTests=false clean verifymvn -o -T5 -s releng/osate.releng/settings.xml -Plocal -Dtycho.localArtifacts=ignore -Dpr.build=true -Dsign=false -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false -DfailIfNoTests=false clean installDependency
Depends on #3116. This PR is based on
3107_remove_dead_property_lookup; after #3116 merges, it can be retargeted tomaster.Compatibility and residual risk
The old public methods on the exported implementation classes are removed, which is a deliberate binary-incompatible choice relative to the 2.18.0 API baseline. This follows the preferred option in #3108; the new interface operation is additive, and the test pins the lookup results for every moved dispatch case.
Fixes #3108