attributes.put("columba.from", "");
}
Address[] to = basicHeader.getTo();
if (to.length > 0) {
// We save only the first item in the to-list
attributes.put("columba.to", to[0]);
} else {
attributes.put("columba.to", "");
}
attributes.put("columba.to", "");
}
Address[] cc = basicHeader.getCc();
if (cc.length > 0) {
// We save only the first item in the cc-list
attributes.put("columba.cc", cc[0]);
} else {
attributes.put("columba.cc", "");
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/message/ColumbaHeader.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/message/ColumbaHeader.java
|
Method name: void ColumbaHeader(Header)
|
|
Method name: void ColumbaHeader(Header)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | attributes.put("columba.from", "");↵ | | 1 | attributes.put("columba.to", "");↵
|
2 | }↵ | | 2 | }↵
|
|
3 | Address[] to = basicHeader.getTo();↵ | | 3 | Address[] cc = basicHeader.getCc();↵
|
|
4 | if (to.length > 0) {↵ | | 4 | if (cc.length > 0) {↵
|
5 | // We save only the first item in the to-list↵ | | 5 | // We save only the first item in the cc-list↵
|
6 | attributes.put("columba.to", to[0]);↵ | | 6 | attributes.put("columba.cc", cc[0]);↵
|
7 | } else {↵ | | 7 | } else {↵
|
8 | attributes.put("columba.to", "");↵ | | 8 | attributes.put("columba.cc", "");↵
|
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.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | Address[] to = basicHeader.getTo(); | | 16 | Address[] cc = basicHeader.getCc(); |
13 | if (to.length > 0) | | 17 | if (cc.length > 0) |
14 | attributes.put("columba.to", to[0]); | | 18 | attributes.put("columba.cc", cc[0]); |
| | | | |
15 | attributes.put("columba.to", ""); | | 19 | attributes.put("columba.cc", ""); |
Precondition Violations (0)
Row |
Violation |