Skip to content

Qualified reference cache reuses results across linking contexts 🤖 #3118

Description

@lwrage

Summary

A qualified AADL reference can remain unresolved when the same reference text is used elsewhere in the resource for an incompatible reference type. The observable failure is a spurious linking diagnostic on the legal reference. The inferred mechanism is that Aadl2LinkingService caches qualified linking results by reference text alone, even though candidate filtering depends on the EReference and referencing context.

This is a correctness prerequisite for #1836 because the linking-contract work must not preserve or amplify an unsound cache result.

Reproduction

Create package Other with data D. In a second package, import Other and declare one system with both features below:

bad: requires bus access Other::D;
good: in data port Other::D;

Force linking or run validation. Reversing the feature order produces the same result.

The bus access correctly reports that Other::D is not a BusFeatureClassifier, but the legal data port also remains an unresolved proxy and reports Couldnt resolve reference to DataSubcomponentType Other::D. A warning that the with Other; clause is unused is a further knock-on diagnostic.

Controls resolve the data port correctly when it is the only reference, when the incompatible reference names another classifier, or when the two references are in separate resources.

Expected behavior

Validation reports only the incompatible bus-access reference. The data port resolves to data classifier D regardless of declaration order, and the import is recognized as used.

Relevant code

  • core/org.osate.xtext.aadl2/src/org/osate/xtext/aadl2/linking/Aadl2LinkingService.java, getLinkedObjects: qualified names are cached under crossRefString.
  • core/org.osate.xtext.aadl2.properties/src/org/osate/xtext/aadl2/properties/linking/PropertiesLinkingService.java, findClassifier: lookup filters by reference type and uses the containing namespace, so text alone is not a complete key.
  • The narrow correctness fix is to key general linking by the node, which uniquely identifies the reference and context. Performance must be measured separately on property-heavy and classifier-heavy models.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions