Skip to content

Commit

Permalink
Avoid removing leaf, if the refactoring is already detected
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Sep 27, 2024
1 parent 29e2156 commit 50c3705
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,10 @@ else if(mapping instanceof CompositeStatementObjectMapping) {
LeafMapping leafMapping = new LeafMapping(subExpression, initializer, operation1, operation2);
ref.addSubExpressionMapping(leafMapping);
}
refactorings.add(ref);
leavesToBeRemovedT2.add(statement);
if(!refactorings.contains(ref)) {
refactorings.add(ref);
leavesToBeRemovedT2.add(statement);
}
}
}
}
Expand Down Expand Up @@ -956,8 +958,10 @@ else if(mapping instanceof CompositeStatementObjectMapping) {
LeafMapping leafMapping = new LeafMapping(initializer, subExpression, operation1, operation2);
ref.addSubExpressionMapping(leafMapping);
}
refactorings.add(ref);
leavesToBeRemovedT1.add(statement);
if(!refactorings.contains(ref)) {
refactorings.add(ref);
leavesToBeRemovedT1.add(statement);
}
}
}
}
Expand Down

0 comments on commit 50c3705

Please sign in to comment.