if (errorPrintStream == null) { errorPrintStream = new PrintStream(errorStream); } errorPrintStream.print(output);
if (outPrintStream == null) { outPrintStream = new PrintStream(outputStream); } outPrintStream.print(output); outPrintStream.flush();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Redirector.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Redirector.java
Method name: void handleErrorOutput(String) Method name: void handleFlush(String)
Number of AST nodes: 3 Number of AST nodes: 4
1
if (errorPrintStream == null) {
1
if (outPrintStream == null) {
2
            errorPrintStream = new PrintStream(errorStream);
2
            outPrintStream = new PrintStream(outputStream);
3
        }
3
        }
4
        errorPrintStream.print(output);
4
        outPrintStream.print(output);
5
        outPrintStream.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.1
Clones locationClones are declared in the same class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (errorPrintStream == null)
    1
    if (errorPrintStream == null)
    1
    if (outPrintStream == null)
    Differences
    Expression1Expression2Difference
    errorPrintStreamoutPrintStreamVARIABLE_NAME_MISMATCH
    1
    if (outPrintStream == null)
    2
    errorPrintStream = new PrintStream(errorStream);
    2
    errorPrintStream = new PrintStream(errorStream);
    2
    outPrintStream = new PrintStream(outputStream);
    Differences
    Expression1Expression2Difference
    errorPrintStreamoutPrintStreamVARIABLE_NAME_MISMATCH
    errorStreamoutputStreamVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression errorPrintStream is a field being modified, and thus it cannot be parameterized
    Expression outPrintStream is a field being modified, and thus it cannot be parameterized
    2
    outPrintStream = new PrintStream(outputStream);
    3
    errorPrintStream.print(output);
    3
    errorPrintStream.print(output);
    3
    outPrintStream.print(output);
    Differences
    Expression1Expression2Difference
    errorPrintStreamoutPrintStreamVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression errorPrintStream cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression outPrintStream cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    outPrintStream.print(output);
                                                        
    4
    outPrintStream.flush();
    Precondition Violations (4)
    Row Violation
    1Expression errorPrintStream is a field being modified, and thus it cannot be parameterized
    2Expression outPrintStream is a field being modified, and thus it cannot be parameterized
    3Expression errorPrintStream cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression outPrintStream cannot be parameterized, because it has dependencies to/from statements that will be extracted