if (signatureFile != null) {
String signature = getSignature(signatureFile);
if (signature != null) {
buf.append("\r\n\r\n");
// TODO: Should we take some action to ensure signature is valid
// html?
buf.append(signature);
}
}
if (appendSignature && signatureFile != null) {
String signature = getSignature(signatureFile);
if (signature != null) {
body = body + "\r\n\r\n" + signature;
}
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/composer/MessageComposer.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/composer/MessageComposer.java
|
Method name: StreamableMimePart composeHtmlMimePart(boolean)
|
|
Method name: StreamableMimePart composeTextMimePart(boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | if (signatureFile != null) {↵ | | 1 | if (appendSignature && signatureFile != null) {↵
|
2 | String signature = getSignature(signatureFile);↵ | | 2 | String signature = getSignature(signatureFile);↵
|
|
3 | if (signature != null) {↵ | | 3 | if (signature != null) {↵
|
4 | buf.append("\r\n\r\n");↵ | | 4 | b↵
|
|
5 | // TODO: Should we take some action to ensure signature is valid↵ | | |
|
6 | // html?↵ | | |
|
7 | buf.append(signature);↵ | | 5 | ody = body + "\r\n\r\n" + signature;↵
|
8 | }↵ | | 6 | }↵
|
9 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.8 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
30 | String signature = getSignature(signatureFile); | | 10 | String signature = getSignature(signatureFile); |
31 | if (signature != null) | | 11 | if (signature != null) |
| | | 12 | body = body + "\r\n\r\n" + signature; |
32 | | | | |
33 | | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement body=body + "\r\n\r\n" + signature; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement buf.append(signature); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |