if (operator == FilterCriteria.CONTAINS) {
return new SearchKey(SearchKey.TO, criteria.getPatternString());
} else {
// contains not
return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.TO,
criteria.getPatternString()));
}
if (operator == FilterCriteria.CONTAINS) {
return new SearchKey(SearchKey.SUBJECT, criteria
.getPatternString());
} else {
// contains not
return new SearchKey(SearchKey.NOT, new SearchKey(
SearchKey.SUBJECT, criteria.getPatternString()));
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/imap/IMAPServer.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/imap/IMAPServer.java
|
Method name: SearchKey getSearchKey(IFilterCriteria)
|
|
Method name: SearchKey getSearchKey(IFilterCriteria)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (operator == FilterCriteria.CONTAINS) {↵ | | 1 | if (operator == FilterCriteria.CONTAINS) {↵
|
2 | return new SearchKey(SearchKey.TO, criteria↵ | | 2 | return new SearchKey(SearchKey.SUBJECT, criteria↵
|
3 | .getPatternString());↵ | | 3 | .getPatternString());↵
|
4 | } else {↵ | | 4 | } else {↵
|
5 | // contains not↵ | | 5 | // contains not↵
|
6 | return new SearchKey(SearchKey.NOT, new SearchKey(↵ | | 6 | return new SearchKey(SearchKey.NOT, new SearchKey(↵
|
7 | SearchKey.TO,↵ | | 7 | SearchKey.↵
|
8 | criteria.getPatternString()));↵ | | 8 | SUBJECT, criteria.getPatternString()));↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
17 | if (operator == FilterCriteria.CONTAINS) | | 21 | if (operator == FilterCriteria.CONTAINS) |
18 | return new SearchKey(SearchKey.TO, criteria.getPatternString()); | | 22 | return new SearchKey(SearchKey.SUBJECT, criteria.getPatternString()); |
| | | | |
19 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.TO, criteria.getPatternString())); | | 23 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.SUBJECT, criteria.getPatternString())); |
Precondition Violations (0)
Row |
Violation |