try { close(); } finally { super.finalize(); }
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/types/resources/ZipResource.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/LineOrientedOutputStream.java
Method name: void finalize() Method name: void processBuffer()
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
                    close();
2
            
3
   
3
processLine(buffer.toString());
4
             } finally {
4
        } finally {
5
                    super.finalize();
5
            
6
        
6
buffer.reset();
7
        }
7
        }
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
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
    super.finalize()buffer.reset()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression buffer.reset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression super.finalize() 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
    close();
    2
    close();
    2
    processLine(buffer.toString());
    Differences
    Expression1Expression2Difference
    closeprocessLineMETHOD_INVOCATION_NAME_MISMATCH
    close()processLine(buffer.toString())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression 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 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 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 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 super.finalize() 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 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 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 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 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