Improvement in the implementation of exactMatches()
Both fragments should be checked if they are countable statements
@@ -678,7 +678,7 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
public int exactMatches() {
int count = 0;
for(AbstractCodeMapping mapping : getMappings()) {
- if(mapping.isExact() && mapping.getFragment1().countableStatement() &&
+ if(mapping.isExact() && mapping.getFragment1().countableStatement() && mapping.getFragment2().countableStatement() &&
!mapping.getFragment1().getString().equals("try"))
count++;
}
@@ -688,7 +688,7 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
public List<AbstractCodeMapping> getExactMatches() {
List<AbstractCodeMapping> exactMatches = new ArrayList<AbstractCodeMapping>();
for(AbstractCodeMapping mapping : getMappings()) {
- if(mapping.isExact() && mapping.getFragment1().countableStatement() &&
+ if(mapping.isExact() && mapping.getFragment1().countableStatement() && mapping.getFragment2().countableStatement() &&
!mapping.getFragment1().getString().equals("try"))
exactMatches.add(mapping);
}
