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

LastStepMappings in case of duplicate code #91

Closed
tsantalis opened this issue Nov 30, 2023 · 2 comments
Closed

LastStepMappings in case of duplicate code #91

tsantalis opened this issue Nov 30, 2023 · 2 comments

Comments

@tsantalis
Copy link

Related to #89

thunderbird/thunderbird-android@9d44f0e

In L3480, the should be multi-mappings for
localFolder.getName() and getRootCauseMessage(e)
These are duplicate codes extracted in a common method notifySynchronizeMailboxFailed()
On top of the extracted statements, there are two Extract Variable refactorings applied, which introduce sub-expression mappings.
Screenshot from 2023-11-30 04-05-38

Activiti/Activiti@a70ca1d
A similar scenario takes place of the sub-expression
persistentObjectsToInsert.size() == 1
One of the duplicated code fragments has an overlapping Split Conditional refactorings, while the other duplicated code fragment in an exact match if (persistentObjectsToInsert.size() == 1).

Screenshot from 2023-11-26 19-40-12

tsantalis added a commit to tsantalis/RefactoringMiner that referenced this issue Dec 2, 2023
@tsantalis
Copy link
Author

tsantalis commented Dec 2, 2023

@pouryafard75
I fixed the first problem. The equals and hashCode of ExtractVariableRefactoring should include the references too.

Screenshot from 2023-12-01 20-01-43

tsantalis added a commit to tsantalis/RefactoringMiner that referenced this issue Dec 2, 2023
@tsantalis
Copy link
Author

tsantalis commented Dec 3, 2023

Screenshot from 2023-12-02 22-17-05

List<PersistentObject> persistentObjectsToInsert
Variable declaration in L788 &
Variable declaration in L802
should have been a multi-mapping with the parameter in R803

R789 is basically an Inline Variable that comes ONLY from L788
R796 is also an Inline Variable that comes from L802, but in this case there is a Rename Variable on top
clazz -> persistentObjectClass

tsantalis added a commit to tsantalis/RefactoringMiner that referenced this issue Dec 3, 2023
Fixes wrong LeafMapping added in VariableReplacementAnalysis
tsantalis added a commit to tsantalis/RefactoringMiner that referenced this issue Dec 3, 2023
pouryafard75 added a commit that referenced this issue Dec 4, 2023
tsantalis pushed a commit to tsantalis/RefactoringMiner that referenced this issue Dec 4, 2023
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

No branches or pull requests

2 participants