checkParameters(); readFile(); executeOperation(); writeFile();
endBlock(); initBlock(); writeRun();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/PropertyFile.java File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java
Method name: void execute() Method name: void writeRun()
Number of AST nodes: 4 Number of AST nodes: 3
1
checkParameters();
2
        readFile();
3
        executeOperation();
1
endBlock();
2
            initBlock();
4
        writeFile();
3
            writeRun();
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.0
Clones locationClones are in different classes
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    checkParameters();
                                              
    2
    readFile();
    2
    readFile();
    37
    endBlock();
    Differences
    Expression1Expression2Difference
    readFileendBlockMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression readFile() is a void method call, and thus it cannot be parameterized
    Expression endBlock() is a void method call, and thus it cannot be parameterized
    37
    endBlock();
    3
    executeOperation();
    3
    executeOperation();
    38
    initBlock();
    Differences
    Expression1Expression2Difference
    executeOperationinitBlockMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression executeOperation() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method executeOperation
    Expression initBlock() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method initBlock
    Expression executeOperation() is a void method call, and thus it cannot be parameterized
    Expression initBlock() is a void method call, and thus it cannot be parameterized
    38
    initBlock();
    4
    writeFile();
    4
    writeFile();
    39
    writeRun();
    Differences
    Expression1Expression2Difference
    writeFilewriteRunMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression writeFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method writeFile
    Expression writeRun() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method writeRun
    Expression writeFile() is a void method call, and thus it cannot be parameterized
    Expression writeRun() is a void method call, and thus it cannot be parameterized
    39
    writeRun();
    Precondition Violations (10)
    Row Violation
    1Expression readFile() is a void method call, and thus it cannot be parameterized
    2Expression endBlock() is a void method call, and thus it cannot be parameterized
    3Expression executeOperation() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression initBlock() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression executeOperation() is a void method call, and thus it cannot be parameterized
    6Expression initBlock() is a void method call, and thus it cannot be parameterized
    7Expression writeFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression writeRun() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression writeFile() is a void method call, and thus it cannot be parameterized
    10Expression writeRun() is a void method call, and thus it cannot be parameterized