Object[] result = new Object[messages.size()]; ListIterator it = messages.listIterator(); int i = 0; while (it.hasNext()) { result[i++] = ((MessageNode) it.next()).getUid(); } return result;
AbstractColumbaAction[] actions = new AbstractColumbaAction[list.size()]; Iterator it = list.iterator(); int i = 0; while (it.hasNext()) { actions[i++] = ((AbstractMailCheckingAction) it.next()); } return actions;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/table/selection/TableSelectionHandler.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/mailchecking/MailCheckingManager.java
Method name: Object[] getUidArray() Method name: AbstractColumbaAction[] getActions()
Number of AST nodes: 6 Number of AST nodes: 6
1
Object[] result = new Object[messages.size()];
1
AbstractColumbaAction[] actions = new AbstractColumbaAction[list.size()];
2
		List
3
Iterator it = messages.listIterator();
2
        Iterator it = list.iterator();
4
		int i = 0;
3
        int i = 0;
5
		while (it.hasNext()) {
4
        while (it.hasNext()) {
6
			result[i++] = ((MessageNode) it.next()).getUid();
7
		}
8
		return result
5
            actions[i++] = ((AbstractMailCheckingAction) it.next());
6
        }
9
;
7
        return actions;
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 in different classes
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)638.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                        
    1
    AbstractColumbaAction[] actions = new AbstractColumbaAction[list.size()];
    1
    Object[] result = new Object[messages.size()];
                                                                                                  
    2
    ListIterator it = messages.listIterator();
    2
    ListIterator it = messages.listIterator();
    2
    Iterator it = list.iterator();
    Differences
    Expression1Expression2Difference
    java.util.ListIteratorjava.util.IteratorSUBCLASS_TYPE_MISMATCH
    java.util.ListIteratorjava.util.IteratorSUBCLASS_TYPE_MISMATCH
    listIteratoriteratorMETHOD_INVOCATION_NAME_MISMATCH
    messageslistVARIABLE_NAME_MISMATCH
    java.util.LinkedListjava.util.ListSUBCLASS_TYPE_MISMATCH
    2
    Iterator it = list.iterator();
    3
    int i = 0;
    3
    int i = 0;
    4
    while (it.hasNext())
    4
    while (it.hasNext())
    4
    while (it.hasNext())
    Differences
    Expression1Expression2Difference
    java.util.ListIteratorjava.util.IteratorSUBCLASS_TYPE_MISMATCH
    4
    while (it.hasNext())
                                                                                                                    
    5
    actions[i++] = ((AbstractMailCheckingAction)it.next());
    Preondition Violations
    Unmatched statement actions[i++]=((AbstractMailCheckingAction)it.next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    actions[i++] = ((AbstractMailCheckingAction)it.next());
    5
    result[i++] = ((MessageNode)it.next()).getUid();
    5
    result[i++] = ((MessageNode)it.next()).getUid();
    Preondition Violations
    Unmatched statement result[i++]=((MessageNode)it.next()).getUid(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                      
                                        
    6
    return actions;
    Preondition Violations
    Unmatched return actions;
    6
    return actions;
    6
    return result;
    6
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (6)
    Row Violation
    1Unmatched statement actions[i++]=((AbstractMailCheckingAction)it.next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement result[i++]=((MessageNode)it.next()).getUid(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return actions;
    4Unmatched return result;
    5Clone fragment #1 returns variables it, i , while Clone fragment #2 returns variables it, i
    6The refactoring of the clones is infeasible, because classes org.columba.mail.gui.table.selection.TableSelectionHandler and org.columba.mail.mailchecking.MailCheckingManager do not have a common superclass