Skip to content

Use virtual dispatch for declarative property lookup 馃 - #3117

Open
lwrage wants to merge 2 commits into
3107_remove_dead_property_lookupfrom
3108_declarative_property_dispatch
Open

Use virtual dispatch for declarative property lookup 馃#3117
lwrage wants to merge 2 commits into
3107_remove_dead_property_lookupfrom
3108_declarative_property_dispatch

Conversation

@lwrage

@lwrage lwrage commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add NamedElement.getPropertyValueForInstance and put the generic behavior in NamedElementOperations
  • override the operation for subcomponents, features, and port connections
  • replace the PropertyImpl type-and-cast chain with one virtual call
  • remove the unreferenced implementation overloads and dead all parameter plumbing

Regression coverage

Issue3108Test instantiates 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 verify
    • 1 test, 0 failures, 0 errors
  • mvn -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 install
    • all 137 reactor projects succeeded

Dependency

Depends on #3116. This PR is based on 3107_remove_dead_property_lookup; after #3116 merges, it can be retargeted to master.

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants