if (environment != null) { for (int i = 0; i < environment.length; i++) { log("Setting environment variable: " + environment[i], Project.MSG_VERBOSE); } }
for (int i = 0; i < r.length; i++) { add(r[i]); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/ExecTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/selectors/ResourceSelectorContainer.java
Method name: Execute prepareExec() Method name: void ResourceSelectorContainer(ResourceSelector[])
Number of AST nodes: 3 Number of AST nodes: 2
1
if (environment != null) {
2
            for (int i = 0; i < environment.length; i++) {
1
for (int i = 0; i < r.length; i++) {
3
                log("Setting environment variable: " + environment[i],
2
            
4
                    Project.MSG_VERBOSE);
5
            }
3
add(r[i]);
6
        }
4
        }
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 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)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    for (int i = 0; i < environment.length; i++)
    12
    for (int i = 0; i < environment.length; i++)
    1
    for (int i = 0; i < r.length; i++)
    Differences
    Expression1Expression2Difference
    environmentrVARIABLE_NAME_MISMATCH
    java.lang.String[]org.apache.tools.ant.types.resources.selectors.ResourceSelector[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String[] of variable environment does not match with type org.apache.tools.ant.types.resources.selectors.ResourceSelector[] of variable r
    • Make classes java.lang.String[] and org.apache.tools.ant.types.resources.selectors.ResourceSelector[] extend a common superclass
    1
    for (int i = 0; i < r.length; i++)
    13
    log("Setting environment variable: " + environment[i], Project.MSG_VERBOSE);
    13
    log("Setting environment variable: " + environment[i], Project.MSG_VERBOSE);
    2
    add(r[i]);
    Differences
    Expression1Expression2Difference
    logaddMETHOD_INVOCATION_NAME_MISMATCH
    log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE)add(r[i])ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(r[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    Expression add(r[i]) is a void method call, and thus it cannot be parameterized
    Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(r[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    Expression add(r[i]) is a void method call, and thus it cannot be parameterized
    2
    add(r[i]);
    Precondition Violations (9)
    Row Violation
    1Type java.lang.String[] of variable environment does not match with type org.apache.tools.ant.types.resources.selectors.ResourceSelector[] of variable r
    2Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression add(r[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    5Expression add(r[i]) is a void method call, and thus it cannot be parameterized
    6Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression add(r[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    9Expression add(r[i]) is a void method call, and thus it cannot be parameterized