if (str.indexOf("@") != -1) {
if (strbuf.length() != 0) {
// found new message
saveMessage(strbuf.toString(), worker,
getDestinationFolder());
count++;
sucess = true;
}
strbuf = new StringBuffer();
} else {
strbuf.append(str + "\n");
}
if (str.indexOf("-") != -1) {
if (strbuf.length() != 0) {
// found new message
saveMessage(strbuf.toString(), worker,
getDestinationFolder());
count++;
sucess = true;
}
strbuf = new StringBuffer();
} else {
strbuf.append(str + "\n");
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/mailboximport/EvolutionImporter.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/mailboximport/MozillaImporter.java
|
Method name: void importMailboxFile(File, IWorkerStatusController, IMailbox)
|
|
Method name: void importMailboxFile(File, IWorkerStatusController, IMailbox)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (str.indexOf("@") != -1) {↵ | | 1 | if (str.indexOf("-") != -1) {↵
|
2 | if (strbuf.length() != 0) {↵ | | 2 | if (strbuf.length() != 0) {↵
|
3 | // found new message↵ | | 3 | // found new message↵
|
4 | saveMessage(strbuf.toString(), worker,↵ | | 4 | saveMessage(strbuf.toString(), worker,↵
|
5 | getDestinationFolder());↵ | | 5 | getDestinationFolder());↵
|
|
6 | count++;↵ | | 6 | count++;↵
|
|
7 | sucess = true;↵ | | 7 | sucess = true;↵
|
8 | }↵ | | 8 | }↵
|
|
9 | strbuf = new StringBuffer();↵ | | 9 | strbuf = new StringBuffer();↵
|
10 | } else {↵ | | 10 | } else {↵
|
11 | strbuf.append(str + "\n");↵ | | 11 | strbuf.append(str + "\n");↵
|
12 | } | | 12 | }
|
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.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 27 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 10.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | if (str.indexOf("@") != -1) | | 11 | if (str.indexOf("-") != -1) |
12 | if (strbuf.length() != 0) | | 12 | if (strbuf.length() != 0) |
13 | saveMessage(strbuf.toString(), worker, getDestinationFolder()); | | 13 | saveMessage(strbuf.toString(), worker, getDestinationFolder()); |
14 | | | 14 | |
15 | | | 15 | |
16 | strbuf = new StringBuffer(); | | 16 | strbuf = new StringBuffer(); |
| | | | |
17 | strbuf.append(str + "\n"); | | 17 | strbuf.append(str + "\n"); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables strbuf, sucess, count , while Clone fragment #2 returns variables strbuf, sucess, count |