Skip to content

Commit

Permalink
Improved Split Test detection in commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Jan 14, 2025
1 parent 0810633 commit 9c2f4bd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/gr/uom/java/xmi/diff/UMLClassBaseDiff.java
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,19 @@ else if(removedOperation.hasTestAnnotation() && addedOperation.hasParameterizedT
}
boolean matchingMergeCandidateFound = false;
boolean matchingSplitCandidateFound = false;
//infer split method
Set<UMLOperationBodyMapper> exactMappers = new LinkedHashSet<>();
CandidateSplitMethodRefactoring newCandidate = new CandidateSplitMethodRefactoring();
newCandidate.setOriginalMethodBeforeSplit(removedOperation);
for(UMLOperationBodyMapper mapper : mapperSet) {
if(mapper.allMappingsAreExactMatches()) {
exactMappers.add(mapper);
newCandidate.addSplitMethod(mapper.getContainer2());
}
}
if(exactMappers.size() < mapperSet.size() && exactMappers.size() > 1) {
candidateMethodSplits.add(newCandidate);
}
if(!firstMapperWithIdenticalMethodName) {
for(CandidateMergeMethodRefactoring candidate : candidateMethodMerges) {
Set<VariableDeclarationContainer> methodsWithMapper = new LinkedHashSet<>();
Expand Down

0 comments on commit 9c2f4bd

Please sign in to comment.