pouryafard75 / RM-ASTDiff

MIT License
2 stars 1 forks source link

LastStepMappings in case of duplicate code #91

Closed tsantalis closed 9 months ago

tsantalis commented 9 months ago

Related to #89

https://github.com/thunderbird/thunderbird-android/commit/9d44f0e06232661259681d64002dd53c7c43099d

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

https://github.com/Activiti/Activiti/commit/a70ca1d9ad2ea07b19c5e1f9540c809d7a12d3fb 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 commented 9 months ago

@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 commented 9 months ago

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