int count = 0; boolean sucess = false; StringBuffer strbuf = new StringBuffer(); BufferedReader in = new BufferedReader(new FileReader(file)); String str; // parse line by line while ((str = in.readLine()) != null) { // if user cancelled task exit immediately if (worker.cancelled() == true) { return; } // if line doesn't start with "From ???@???" or line length is 0 // -> save everything in StringBuffer if ((str.startsWith("From ???@???") == false) || (str.length() == 0)) { strbuf.append(str + "\n");
int count = 0; boolean sucess = false; StringBuffer strbuf = new StringBuffer(); BufferedReader in = new BufferedReader(new FileReader(file)); String str; // parse line by line while ((str = in.readLine()) != null) { // if user cancelled task exit immediately if (worker.cancelled() == true) { return; } // if line doesn't start with "From" or line length is 0 // -> save everything in StringBuffer if ((str.startsWith("From ") == false) || (str.length() == 0)) { 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/PegasusMailImporter.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
int count = 0;
1
int count = 0;
2
        boolean sucess = false;
2
        boolean sucess = false;
3
        StringBuffer strbuf = new StringBuffer();
3
        StringBuffer strbuf = new StringBuffer();
4
        BufferedReader in = new BufferedReader(new FileReader(file));
4
        BufferedReader in = new BufferedReader(new FileReader(file));
5
        String str;
5
        String str;
6
        // parse line by line
6
        // parse line by line
7
        while ((str = in.readLine()) != null) {
7
        while ((str = in.readLine()) != null) {
8
            // if user cancelled task exit immediately
8
            // if user cancelled task exit immediately
9
            if (worker.cancelled() == true) {
9
            if (worker.cancelled() == true) {
10
                return;
10
                return;
11
            }
11
            }
12
            // if line doesn't start with "From ???@???" or line length is 0
12
            // if line doesn't start with "From" or line length is 0
13
            //  -> save everything in StringBuffer
13
            //  -> save everything in StringBuffer
14
            if ((str.startsWith("From ???@???") == false) ||
14
            if ((str.startsWith("From ") == false) ||
15
                    (str.length() == 0)) {
15
 (str.length() == 0)) {
16
                strbuf.append(str + "\n");
16
                strbuf.append(str + "\n");
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    7
    if (worker.cancelled() == true)
    7
    if (worker.cancelled() == true)
    8
    return;
    8
    return;
    8
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    8
    return;
    Precondition Violations (2)
    Row Violation
    1Conditional return;
    2Conditional return;