Avoid redundant executions of checkForExtractedAndMovedOperations()
Eliminates duplicate Extract And Move Method refactorings in commit
@@ -1874,7 +1874,9 @@ public class UMLModelDiff {
for(Iterator<UMLOperation> addedOperationIterator = addedOperations.iterator(); addedOperationIterator.hasNext();) {
UMLOperation addedOperation = addedOperationIterator.next();
for(UMLOperationBodyMapper mapper : mappers) {
- if((mapper.nonMappedElementsT1() > 0 || !mapper.getReplacementsInvolvingMethodInvocation().isEmpty()) && !mapper.containsExtractOperationRefactoring(addedOperation)) {
+ Pair<UMLOperation, UMLOperation> pair = Pair.of(mapper.getOperation1(), addedOperation);
+ if((mapper.nonMappedElementsT1() > 0 || !mapper.getReplacementsInvolvingMethodInvocation().isEmpty()) && !mapper.containsExtractOperationRefactoring(addedOperation) && !processedOperationPairs.contains(pair)) {
+ processedOperationPairs.add(pair);
List<OperationInvocation> operationInvocations = ExtractOperationDetection.getInvocationsInSourceOperationAfterExtraction(mapper);
List<OperationInvocation> addedOperationInvocations = new ArrayList<OperationInvocation>();
for(OperationInvocation invocation : operationInvocations) {
