Worker[] workers = taskManager.getWorkers(); for (int i = 0; i < workers.length; i++) { model.addElement(workers[i]); }
Object[] _uidList = headerList.getUids(); for (int i = 0; i < _uidList.length; i++) { _headerList.add(_uidList[i]); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/statusbar/TaskManagerDialog.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/AbstractLocalFolder.java
Method name: void initComponents() Method name: Object generateNextMessageUid()
Number of AST nodes: 3 Number of AST nodes: 3
1
Worker[] workers = taskManager.getWorkers();
1
Object[] _uidList = headerList.getUids();
2
		for (int i = 0; i < workers.length; i++) {
2
					for (int i = 0; i < _uidList.length; i++) {
3
			model.addElement(workers[i]);
3
						_headerList.add(_uidList[i]);
4
		}
4
					}
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.3
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                        
    5
    Object[] _uidList = headerList.getUids();
    31
    Worker[] workers = taskManager.getWorkers();
                                                                                                
    32
    for (int i = 0; i < workers.length; i++)
    32
    for (int i = 0; i < workers.length; i++)
    6
    for (int i = 0; i < _uidList.length; i++)
    Differences
    Expression1Expression2Difference
    workers_uidListVARIABLE_NAME_MISMATCH
    org.columba.core.command.Worker[]java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable workers.length does not match with type int of variable _uidList.length
    • Make classes org.columba.core.command.Worker[] and java.lang.Object[] extend a common superclass
    6
    for (int i = 0; i < _uidList.length; i++)
                                                                    
    7
    _headerList.add(_uidList[i]);
    Preondition Violations
    Unmatched statement _headerList.add(_uidList[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    _headerList.add(_uidList[i]);
    33
    model.addElement(workers[i]);
    33
    model.addElement(workers[i]);
    Preondition Violations
    Unmatched statement model.addElement(workers[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
    Precondition Violations (4)
    Row Violation
    1Type int of variable workers.length does not match with type int of variable _uidList.length
    2Unmatched statement _headerList.add(_uidList[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement model.addElement(workers[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero