Skip to content

Commit

Permalink
Improvement over previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Jan 14, 2025
1 parent 9c2f4bd commit be8dadc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3962,6 +3962,16 @@ else if(f1 instanceof StatementObject && f2 instanceof StatementObject) {
return false;
}

public boolean allMappingsAreIdentical() {
int identical = 0;
for(AbstractCodeMapping mapping : this.getMappings()) {
if(mapping.getFragment1().getString().equals(mapping.getFragment2().getString())) {
identical++;
}
}
return identical == this.getMappings().size() && identical > 0;
}

public boolean allMappingsAreExactMatches() {
int mappings = this.mappingsWithoutBlocks();
int tryMappings = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gr/uom/java/xmi/diff/UMLClassBaseDiff.java
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ else if(removedOperation.hasTestAnnotation() && addedOperation.hasParameterizedT
CandidateSplitMethodRefactoring newCandidate = new CandidateSplitMethodRefactoring();
newCandidate.setOriginalMethodBeforeSplit(removedOperation);
for(UMLOperationBodyMapper mapper : mapperSet) {
if(mapper.allMappingsAreExactMatches()) {
if(mapper.allMappingsAreIdentical()) {
exactMappers.add(mapper);
newCandidate.addSplitMethod(mapper.getContainer2());
}
Expand Down

0 comments on commit be8dadc

Please sign in to comment.