Handles case
@@ -623,7 +623,14 @@ public abstract class UMLClassBaseDiff extends UMLAbstractClassDiff implements C
}
}
if(!mapperSet.isEmpty()) {
+ boolean firstMapperWithIdenticalMethodName = false;
+ UMLOperationBodyMapper firstMapper = mapperSet.first();
+ if(firstMapper.getContainer1().getName().equals(firstMapper.getContainer2().getName())) {
+ firstMapperWithIdenticalMethodName = true;
+ }
boolean matchingMergeCandidateFound = false;
+ boolean matchingSplitCandidateFound = false;
+ if(!firstMapperWithIdenticalMethodName) {
for(CandidateMergeMethodRefactoring candidate : candidateMethodMerges) {
Set<VariableDeclarationContainer> methodsWithMapper = new LinkedHashSet<>();
for(UMLOperationBodyMapper mapper : mapperSet) {
@@ -642,7 +649,6 @@ public abstract class UMLClassBaseDiff extends UMLAbstractClassDiff implements C
}
}
}
- boolean matchingSplitCandidateFound = false;
for(CandidateSplitMethodRefactoring candidate : candidateMethodSplits) {
Set<VariableDeclarationContainer> methodsWithMapper = new LinkedHashSet<>();
for(UMLOperationBodyMapper mapper : mapperSet) {
@@ -661,6 +667,7 @@ public abstract class UMLClassBaseDiff extends UMLAbstractClassDiff implements C
}
}
}
+ }
if(!matchingMergeCandidateFound && !matchingSplitCandidateFound) {
UMLOperationBodyMapper bestMapper = findBestMapper(mapperSet);
if(bestMapper != null) {
@@ -733,7 +740,14 @@ public abstract class UMLClassBaseDiff extends UMLAbstractClassDiff implements C
}
}
if(!mapperSet.isEmpty()) {
+ boolean firstMapperWithIdenticalMethodName = false;
+ UMLOperationBodyMapper firstMapper = mapperSet.first();
+ if(firstMapper.getContainer1().getName().equals(firstMapper.getContainer2().getName())) {
+ firstMapperWithIdenticalMethodName = true;
+ }
boolean matchingMergeCandidateFound = false;
+ boolean matchingSplitCandidateFound = false;
+ if(!firstMapperWithIdenticalMethodName) {
for(CandidateMergeMethodRefactoring candidate : candidateMethodMerges) {
Set<VariableDeclarationContainer> methodsWithMapper = new LinkedHashSet<>();
for(UMLOperationBodyMapper mapper : mapperSet) {
@@ -752,7 +766,6 @@ public abstract class UMLClassBaseDiff extends UMLAbstractClassDiff implements C
}
}
}
- boolean matchingSplitCandidateFound = false;
for(CandidateSplitMethodRefactoring candidate : candidateMethodSplits) {
Set<VariableDeclarationContainer> methodsWithMapper = new LinkedHashSet<>();
for(UMLOperationBodyMapper mapper : mapperSet) {
@@ -771,6 +784,7 @@ public abstract class UMLClassBaseDiff extends UMLAbstractClassDiff implements C
}
}
}
+ }
if(!matchingMergeCandidateFound && !matchingSplitCandidateFound) {
UMLOperationBodyMapper bestMapper = findBestMapper(mapperSet);
if(bestMapper != null) {
