strbuf.append(str + "\n"); } else { // line contains "-" (mozilla mbox style) // -> import message in Columba 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"); }
strbuf.append(str + "\n"); } else { // line contains "@" (evolution mbox style) or // -> import message in Columba 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/MozillaImporter.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/mailboximport/EvolutionImporter.java
Method name: void importMailboxFile(File, IWorkerStatusController, IMailbox) Method name: void importMailboxFile(File, IWorkerStatusController, IMailbox)
Number of AST nodes: 8 Number of AST nodes: 8
1
strbuf.append(str + "\n");
1
strbuf.append(str + "\n");
2
            } else {
2
            } else {
3
                // line contains "-" (mozilla mbox style)
3
                // line contains "@" (evolution mbox style) or
4
                //  -> import message in Columba
4
                //  -> import message in Columba
5
                if (str.indexOf("-") != -1) {
5
                if (str.indexOf("@") != -1) {
6
                    if (strbuf.length() != 0) {
6
                    if (strbuf.length() != 0) {
7
                        // found new message
7
                        // found new message
8
                        saveMessage(strbuf.toString(), worker,
8
                        saveMessage(strbuf.toString(), worker,
9
                            getDestinationFolder());
9
                            getDestinationFolder());
10
                        count++;
10
                        count++;
11
                        sucess = true;
11
                        sucess = true;
12
                    }
12
                    }
13
                    strbuf = new StringBuffer();
13
                    strbuf = new StringBuffer();
14
                } else {
14
                } else {
15
                    strbuf.append(str + "\n");
15
                    strbuf.append(str + "\n");
16
                }
16
                }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are in different classes having the same super class
Number of node comparisons28
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)11.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    strbuf.append(str + "\n");
    10
    strbuf.append(str + "\n");
    11
    if (str.indexOf("-") != -1)
    11
    if (str.indexOf("-") != -1)
    11
    if (str.indexOf("@") != -1)
    Differences
    Expression1Expression2Difference
    "-""@"LITERAL_VALUE_MISMATCH
    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
    count++;
    14
    count++;
    15
    sucess = true;
    15
    sucess = true;
    16
    strbuf = new StringBuffer();
    16
    strbuf = new StringBuffer();
    else
    else
    17
    strbuf.append(str + "\n");
    17
    strbuf.append(str + "\n");
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables sucess, strbuf, count , while Clone fragment #2 returns variables sucess, strbuf, count