Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniform attribute level refactoring types #98

Merged
merged 8 commits into from
Jul 17, 2020
Merged

Uniform attribute level refactoring types #98

merged 8 commits into from
Jul 17, 2020

Conversation

jodavimehran
Copy link
Contributor

There are some attribute level refactoring-types like ChangeAttributeTypeRefactoring, RenameAttributeRefactoring, MergeAttributeRefactoring, and SplitAttributeRefactoring has instances of VariableDeclaration class as attributes to keep the state of a refactored attribute before and after refactoring.
However, the other attribute level refactoring types like MoveAttributeRefactoring and AddAttributeAnnotationRefactoring have instances of UMLAttribute class to do the same.

Therefore, to make the code more uniform, it is better to refactor those refactoring classes to use UMLAttribute, which contains more information in comparison to VariableDeclaration.

@tsantalis
Copy link
Owner

This change has many implications that you did not consider.
The UMLAttribute.toString() is different than the VariableDeclaration.toString(), which affects the refactoring descriptions generated by toString(). This will make the test calculating the precision and recall to fail in matching some cases in the oracle.
Also equals() and hashCode() have a different behaviour, because VariableDeclaration takes into account the VariableScope, while UMLAttribute does not take into account the VariableScope.
The toString(), equals() and hashCode() in all 4 refactorings should be updated to be consistent with the previous implementation.

…are updated to be consistent with the previous implementation
@tsantalis
Copy link
Owner

@jodavimehran Thanks for updating toString(), equals() and hashCode()
Could you please do the same for leftSide() and rightSide() in all 4 refactorings?
Replace attribute with attribute.getVariableDeclaration()

…re updated to be consistent with the previous implementation
@tsantalis tsantalis merged commit e5e6419 into tsantalis:master Jul 17, 2020
tsantalis added a commit that referenced this pull request Jul 17, 2020
@jodavimehran jodavimehran deleted the uniform-attribute-level-refactorings branch July 17, 2020 15:30
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