for (int i = 0; i < replacefilters.size(); i++) { Replacefilter element = (Replacefilter) replacefilters.elementAt(i); element.validate(); }
for (int i = 0; i < replacefilters.size(); i++) { Replacefilter filter = (Replacefilter) replacefilters.elementAt(i); filter.flush(); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Replace.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Replace.java
Method name: void validateReplacefilters() Method name: void flushFilterChain()
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int i = 0; i < replacefilters.size(); i++) {
1
for (int i = 0; i < replacefilters.size(); i++) {
2
            Replacefilter element =
2
            Replacefilter 
3
                (Replacefilter) replacefilters.elementAt(i);
3
filter = (Replacefilter) replacefilters.elementAt(i);
4
            element.validate();
4
            filter.flush();
5
        }
5
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < replacefilters.size(); i++)
    1
    for (int i = 0; i < replacefilters.size(); i++)
    2
    Replacefilter element = (Replacefilter)replacefilters.elementAt(i);
    2
    Replacefilter element = (Replacefilter)replacefilters.elementAt(i);
    2
    Replacefilter filter = (Replacefilter)replacefilters.elementAt(i);
    Differences
    Expression1Expression2Difference
    elementfilterVARIABLE_NAME_MISMATCH
    2
    Replacefilter filter = (Replacefilter)replacefilters.elementAt(i);
    3
    element.validate();
    3
    element.validate();
    3
    filter.flush();
    Differences
    Expression1Expression2Difference
    validateflushMETHOD_INVOCATION_NAME_MISMATCH
    elementfilterVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression element.validate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression filter.flush() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression element.validate() is a void method call, and thus it cannot be parameterized
    Expression filter.flush() is a void method call, and thus it cannot be parameterized
    3
    filter.flush();
    Precondition Violations (4)
    Row Violation
    1Expression element.validate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression filter.flush() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression element.validate() is a void method call, and thus it cannot be parameterized
    4Expression filter.flush() is a void method call, and thus it cannot be parameterized