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); log("Replacing in " + filename + ": " + filter.getToken() + " --> " + filter.getReplaceValue(), Project.MSG_VERBOSE); }
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 logFilterChain(String)
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
            log("Replacing in " + filename + ": " + filter.getToken()
5
);
5
                    + " --> " + filter.getReplaceValue(), Project.MSG_VERBOSE);
6
        }
6
        }
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.2
Clones locationClones are declared in the same class
Number of node comparisons9
  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 fragment0
    Time elapsed for statement mapping (ms)0.8
    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
    log("Replacing in " + filename + ": " + filter.getToken() + " --> " + filter.getReplaceValue(), Project.MSG_VERBOSE);
    Differences
    Expression1Expression2Difference
    validatelogMETHOD_INVOCATION_NAME_MISMATCH
    element.validate()log("Replacing in " + filename + ": "+ filter.getToken()+ " --> "+ filter.getReplaceValue(),Project.MSG_VERBOSE)ARGUMENT_NUMBER_MISMATCH
    elementMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression element.validate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log("Replacing in " + filename + ": "+ filter.getToken()+ " --> "+ filter.getReplaceValue(),Project.MSG_VERBOSE) 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 log("Replacing in " + filename + ": "+ filter.getToken()+ " --> "+ filter.getReplaceValue(),Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    Expression element.validate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log("Replacing in " + filename + ": "+ filter.getToken()+ " --> "+ filter.getReplaceValue(),Project.MSG_VERBOSE) 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 log("Replacing in " + filename + ": "+ filter.getToken()+ " --> "+ filter.getReplaceValue(),Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    3
    log("Replacing in " + filename + ": " + filter.getToken() + " --> " + filter.getReplaceValue(), Project.MSG_VERBOSE);
    Precondition Violations (8)
    Row Violation
    1Expression element.validate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression log("Replacing in " + filename + ": "+ filter.getToken()+ " --> "+ filter.getReplaceValue(),Project.MSG_VERBOSE) 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 log("Replacing in " + filename + ": "+ filter.getToken()+ " --> "+ filter.getReplaceValue(),Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    5Expression element.validate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression log("Replacing in " + filename + ": "+ filter.getToken()+ " --> "+ filter.getReplaceValue(),Project.MSG_VERBOSE) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression element.validate() is a void method call, and thus it cannot be parameterized
    8Expression log("Replacing in " + filename + ": "+ filter.getToken()+ " --> "+ filter.getReplaceValue(),Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized