if (comp instanceof JScrollPane) { for (int i = 0; i < filters.length; i++) { model.addFilter((Filter) filters[i]); } }
for (int i = 0; i < str.length; i++) { list.add(str[i]); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/filter/FilterTransferHandler.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/tree/util/TreeNodeList.java
Method name: boolean importData(JComponent, Transferable) Method name: void TreeNodeList(String[])
Number of AST nodes: 3 Number of AST nodes: 2
1
if (comp instanceof JScrollPane) {
2
					for (int i = 0; i < filters.length; i++) {
1
for (int i = 0; i < str.length; i++) {
3
						model.addFilter((Filter) filters[i]);
4
					}
5
				
2
            list.add(str[i]);
6
}
3
        }
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 comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    21
    for (int i = 0; i < filters.length; i++)
    21
    for (int i = 0; i < filters.length; i++)
    1
    for (int i = 0; i < str.length; i++)
    Differences
    Expression1Expression2Difference
    filtersstrVARIABLE_NAME_MISMATCH
    java.lang.Object[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable filters.length does not match with type int of variable str.length
    • Make classes java.lang.Object[] and java.lang.String[] extend a common superclass
    1
    for (int i = 0; i < str.length; i++)
                                            
    2
    list.add(str[i]);
    Preondition Violations
    Unmatched statement list.add(str[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    list.add(str[i]);
    22
    model.addFilter((Filter)filters[i]);
    22
    model.addFilter((Filter)filters[i]);
    Preondition Violations
    Unmatched statement model.addFilter((Filter)filters[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement model.addFilter((Filter)filters[i]); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                    
    Precondition Violations (5)
    Row Violation
    1Type int of variable filters.length does not match with type int of variable str.length
    2Unmatched statement list.add(str[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement model.addFilter((Filter)filters[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement model.addFilter((Filter)filters[i]); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero