osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
39 stars 8 forks source link

Rename refactoring fails for record fields #2077

Closed lwrage closed 4 years ago

lwrage commented 4 years ago

Summary

When renaming a record filed only the name in the declaration is updated.

Expected and Current Behavior

All use sites are reported as problematic: "Refactoring introduces a name conflict." There is no real conflict.

Steps to Reproduce

  1. Create a record property type and an AADL model that uses sets a field.
  2. Position the cursor on the field name and invoke renaming (Alt+Shilt+R)
  3. A dialog pops up with the invalid error messages.

Environment

lwrage commented 4 years ago

PropertiesScopeProvider contains this code:

def scope_BasicPropertyAssociation_property(Element context, EReference reference) {
    var parent = switch context {
        BasicPropertyAssociation case context.property.propertyType === null:
            context.owner
        default:
            context
    }
...

Removing case context.property.propertyType === null seems to fix the issue.