try { left.close(); } finally { right.close(); }
try { processLine(buffer.toString()); } finally { buffer.reset(); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/TeeOutputStream.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/LineOrientedOutputStream.java
Method name: void close() Method name: void processBuffer()
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
            left.close();
2
            processLine(buffer.toString());
3
        } finally {
3
        } finally {
4
            right.close();
4
            buffer.reset();
5
        }
5
        }
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 in different classes having the same super class
Number of node comparisons4
  1. {Non-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)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    closeresetMETHOD_INVOCATION_NAME_MISMATCH
    rightbufferVARIABLE_NAME_MISMATCH
    java.io.OutputStreamjava.io.ByteArrayOutputStreamSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression buffer.reset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression right.close() is a void method call, and thus it cannot be parameterized
    Expression buffer.reset() is a void method call, and thus it cannot be parameterized
    1
    try
    2
    left.close();
    2
    left.close();
    2
    processLine(buffer.toString());
    Differences
    Expression1Expression2Difference
    closeprocessLineMETHOD_INVOCATION_NAME_MISMATCH
    left.close()processLine(buffer.toString())ARGUMENT_NUMBER_MISMATCH
    leftMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression left.close() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression processLine(buffer.toString()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression left.close() is a void method call, and thus it cannot be parameterized
    Expression processLine(buffer.toString()) is a void method call, and thus it cannot be parameterized
    Expression left.close() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression processLine(buffer.toString()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression left.close() is a void method call, and thus it cannot be parameterized
    Expression processLine(buffer.toString()) is a void method call, and thus it cannot be parameterized
    2
    processLine(buffer.toString());
    Precondition Violations (11)
    Row Violation
    1Expression buffer.reset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression right.close() is a void method call, and thus it cannot be parameterized
    3Expression buffer.reset() is a void method call, and thus it cannot be parameterized
    4Expression left.close() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    5Expression processLine(buffer.toString()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    6Expression left.close() is a void method call, and thus it cannot be parameterized
    7Expression processLine(buffer.toString()) is a void method call, and thus it cannot be parameterized
    8Expression left.close() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    9Expression processLine(buffer.toString()) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    10Expression left.close() is a void method call, and thus it cannot be parameterized
    11Expression processLine(buffer.toString()) is a void method call, and thus it cannot be parameterized