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
                }
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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 strbuf, sucess, count , while Clone fragment #2 returns variables strbuf, sucess, count