for (int i = 0; i < files.length; i++) { addCommandArgument(files[i]); }
for (int i = 0; i < files.length; i++) { processFile(files[i]); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/FixCRLF.java
Method name: void execute() Method name: void execute()
Number of AST nodes: 2 Number of AST nodes: 2
1
for (int i = 0; i < files.length; i++) {
1
for (int i = 0; i < files.length; i++) {
2
                        addCommandArgument(files[i]);
2
            
3
            
3
processFile(files[i]);
4
        }
4
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {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)18.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    33
    for (int i = 0; i < files.length; i++)
    6
    for (int i = 0; i < files.length; i++)
    34
    addCommandArgument(files[i]);
    34
    addCommandArgument(files[i]);
    7
    processFile(files[i]);
    Differences
    Expression1Expression2Difference
    addCommandArgumentprocessFileMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression addCommandArgument(files[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression processFile(files[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method processFile
    Expression addCommandArgument(files[i]) is a void method call, and thus it cannot be parameterized
    Expression processFile(files[i]) is a void method call, and thus it cannot be parameterized
    7
    processFile(files[i]);
    Precondition Violations (4)
    Row Violation
    1Expression addCommandArgument(files[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression processFile(files[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression addCommandArgument(files[i]) is a void method call, and thus it cannot be parameterized
    4Expression processFile(files[i]) is a void method call, and thus it cannot be parameterized