Closed lwrage closed 4 years ago
Renaming calls Aadl2SerializerScopeProvider to get the scope for the reference to theBus
(in org.eclipse.xtext.ui.refactoring.impl.RefactoringCrossReferenceSerializer.getCrossRefText()). When processing the property value at the port connection the scope is empty. This is wrong.
The bug is in PropertiesScopeProvider.namespaceForPropertyAssociation(). It does not return the classifier for local property associations of connections (and other elements that do not reference a classifier). It returns the connection (or other element), instead.
I'm not convinced that this is a bug in the scope provider. Is it instead a bug that the linking service is resolving the reference to theBus
in the property association on conn1
? In other words, is it legal to have a reference value in a property association that is not a direct child of a classifier, feature group, or subcomponent?
Naming rule N6 of section 11.4 says, "If a reference property is associated with a core AADL model element, then the contained model element path of a reference term can only refer to a core AADL model element. The first identifier in the path must be defined in the namespace of the directly enclosing component that contains the property association or the classifier of the subcomponent when associated with a subcomponent."
In this case, the property association does not have a directly enclosing component, since it is indirectly enclosed by the component implementation via the connection and the connection has no namespace.
It should probably read closest enclosing component or so. This was discussed a couple of years ago: the goal was to allow local property associations for Actual_Connection_Binding. The linking service is correct, the standard still a bit unclear, and the scoping clearly wrong.
Summary
There is a case where renaming a subcomponent does not rename a reference to this subcomponent in a property association.
Expected and Current Behavior
The model below has two references to bus subcomponent
theBus
. When renamingtheBus
to, for example,theBus1
, it is renamed in the properties section but not in the property association at connectionconni
. Both should be renamed.Note that highlighting references works.
Steps to Reproduce
theBus
intop.i
Environment