PrintStream writer = new PrintStream(out); writer.print(n); writer.flush();
FileOutputStream outstream = new FileOutputStream(propsFile); props.store(outstream, "Ant JUnitTask generated properties file"); outstream.close();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/UUEncoder.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Method name: void encodeString(String) Method name: TestResultHolder executeAsForked(JUnitTest, ExecuteWatchdog, File)
Number of AST nodes: 3 Number of AST nodes: 3
1
PrintStream writer = new PrintStream(out);
2
        writer.print(n);
3
        writer.flush
1
FileOutputStream outstream = new FileOutputStream(propsFile);
2
            props.store(outstream, "Ant JUnitTask generated properties file");
4
();
3
            outstream.close();
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 3
    Mapped Statements
    ID Statement ID Statement
    1
    PrintStream writer = new PrintStream(out);
                                                                                          
    2
    writer.print(n);
    2
    writer.print(n);
    56
    outstream.close();
    Differences
    Expression1Expression2Difference
    printcloseMETHOD_INVOCATION_NAME_MISMATCH
    writeroutstreamVARIABLE_NAME_MISMATCH
    java.io.PrintStreamjava.io.FileOutputStreamSUBCLASS_TYPE_MISMATCH
    writer.print(n)outstream.close()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression writer.print(n) is a void method call, and thus it cannot be parameterized
    Expression outstream.close() is a void method call, and thus it cannot be parameterized
    Expression writer.print(n) is a void method call, and thus it cannot be parameterized
    Expression outstream.close() is a void method call, and thus it cannot be parameterized
    56
    outstream.close();
    3
    writer.flush();
                                        
    Precondition Violations (4)
    Row Violation
    1Expression writer.print(n) is a void method call, and thus it cannot be parameterized
    2Expression outstream.close() is a void method call, and thus it cannot be parameterized
    3Expression writer.print(n) is a void method call, and thus it cannot be parameterized
    4Expression outstream.close() is a void method call, and thus it cannot be parameterized