out = new FileWriter(crashFile); out.write(testCase + "\n"); out.flush();
output = new FileOutputStream(destFile); manifest.write(output); output.flush();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/JarLibManifestTask.java
Method name: void registerTestCase(String) Method name: void writeManifest(Manifest)
Number of AST nodes: 3 Number of AST nodes: 3
1
out = new FileWriter(crashFile);
1
output = new FileOutputStream(destFile);
2
                    out.write(testCase + "\n");
2
            manifest.write(output);
3
                    out.flush();
3
            output.flush();
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 comparisons9
  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)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    out.flush();
    7
    out.flush();
    5
    output.flush();
    Differences
    Expression1Expression2Difference
    outoutputVARIABLE_NAME_MISMATCH
    java.io.FileWriterjava.io.FileOutputStreamVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.io.FileWriter of variable out does not match with type java.io.FileOutputStream of variable output
    • Make classes java.io.FileWriter and java.io.FileOutputStream extend a common superclass
    5
    output.flush();
    Precondition Violations (1)
    Row Violation
    1Type java.io.FileWriter of variable out does not match with type java.io.FileOutputStream of variable output