pouryafard75 / RM-ASTDiff

MIT License
2 stars 1 forks source link

How are these return false; statements get matched? #87

Closed tsantalis closed 1 year ago

tsantalis commented 1 year ago

https://github.com/thymeleaf/thymeleaf/commit/378ba37750a9cb1b19a6db434dfa59308f721ea6

These two return false; statements shouldn't be matched. @pouryafard75 Is this related to matching the remaining unmatched statements?

Screenshot from 2023-08-10 20-34-55

pouryafard75 commented 1 year ago

Yes, they are identical blocks and they are matched by the MissingIdenticalSubTree matcher. You can disable this matcher by commenting out the code (Lines 62-65 in the ProjectASTDiffer) I will also add a constraint to avoid block matching in this phase.

pouryafard75 commented 1 year ago

@tsantalis Fixed https://github.com/pouryafard75/RM-ASTDiff/commit/642c22949230186386989fb4eed651c3bbe5e66a

image
tsantalis commented 1 year ago

@pouryafard75 The rule is too strict perhaps. I would exclude common return statements with default values return true return false return null return NumberLiteral

tsantalis commented 1 year ago

@pouryafard75 This is also related to the same problem, I think https://github.com/tsantalis/RefactoringMiner/issues/517#issuecomment-1672406988

pouryafard75 commented 1 year ago

@tsantalis Fixed

image