getMutex(); SendList actList = (SendList) sendAccounts.get(0); Object output = actList.getFirst().getUID(); counter--; if (actList.count() == 0) { sendAccounts.remove(0); } releaseMutex(); return output;
getMutex(); SendList actList = (SendList) sendAccounts.get(0); SendableMessage output = actList.getFirst(); counter--; if (actList.count() == 0) { sendAccounts.remove(0); } releaseMutex(); return output;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/outbox/SendListManager.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/outbox/SendListManager.java
Method name: Object getNextUid() Method name: SendableMessage getNextMessage()
Number of AST nodes: 8 Number of AST nodes: 8
1
getMutex();
1
getMutex();
2
        SendList actList = (SendList) sendAccounts.get(0);
2
        SendList actList = (SendList) sendAccounts.get(0);
3
        Object output = actList.getFirst().getUID();
3
        SendableMessage output = actList.getFirst();
4
        counter--;
4
        counter--;
5
        if (actList.count() == 0) {
5
        if (actList.count() == 0) {
6
            sendAccounts.remove(0);
6
            sendAccounts.remove(0);
7
        }
7
        }
8
        releaseMutex();
8
        releaseMutex();
9
        return output;
9
        return output;
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.2
Clones locationClones are declared in the same class
Number of node comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    getMutex();
    1
    getMutex();
    2
    SendList actList = (SendList)sendAccounts.get(0);
    2
    SendList actList = (SendList)sendAccounts.get(0);
                                                                                              
    3
    SendableMessage output = actList.getFirst();
    Preondition Violations
    Unmatched statement SendableMessage output=actList.getFirst(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    SendableMessage output = actList.getFirst();
    3
    Object output = actList.getFirst().getUID();
    3
    Object output = actList.getFirst().getUID();
    Preondition Violations
    Unmatched statement Object output=actList.getFirst().getUID(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
    4
    counter--;
    4
    counter--;
    5
    if (actList.count() == 0)
    5
    if (actList.count() == 0)
    6
    sendAccounts.remove(0);
    6
    sendAccounts.remove(0);
    7
    releaseMutex();
    7
    releaseMutex();
                                      
    8
    return output;
    Preondition Violations
    Unmatched return output;
    8
    return output;
    8
    return output;
    8
    return output;
    Preondition Violations
    Unmatched return output;
                                      
    Precondition Violations (4)
    Row Violation
    1Unmatched statement SendableMessage output=actList.getFirst(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Object output=actList.getFirst().getUID(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return output;
    4Unmatched return output;