if (environment != null) { for (int i = 0; i < environment.length; i++) { log("Setting environment variable: " + environment[i], Project.MSG_VERBOSE); } }
if (s != null) { for (int j = 0; j < s.length; j++) { list.add(s[j]); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Java.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Commandline.java
Method name: void setupEnvironment(Execute) Method name: void addArgumentsToList(ListIterator)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (environment != null) {
1
if (s != null) {
2
            for (int i = 0; i < environment.length; i++) {
2
                for (int j = 0; j < s.length; j++) {
3
                log("Setting environment variable: " + environment[i],
3
                
4
                    Project.MSG_VERBOSE);
4
    list.add(s[j]);
5
                }
5
            }
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 in different classes
Number of node comparisons5
  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)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (environment != null)
    2
    if (environment != null)
    4
    if (s != null)
    Differences
    Expression1Expression2Difference
    environmentsVARIABLE_NAME_MISMATCH
    4
    if (s != null)
    3
    for (int i = 0; i < environment.length; i++)
    3
    for (int i = 0; i < environment.length; i++)
    5
    for (int j = 0; j < s.length; j++)
    Differences
    Expression1Expression2Difference
    ijVARIABLE_NAME_MISMATCH
    ijVARIABLE_NAME_MISMATCH
    environmentsVARIABLE_NAME_MISMATCH
    ijVARIABLE_NAME_MISMATCH
    5
    for (int j = 0; j < s.length; j++)
    4
    log("Setting environment variable: " + environment[i], Project.MSG_VERBOSE);
    4
    log("Setting environment variable: " + environment[i], Project.MSG_VERBOSE);
    6
    list.add(s[j]);
    Differences
    Expression1Expression2Difference
    logaddMETHOD_INVOCATION_NAME_MISMATCH
    log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE)list.add(s[j])ARGUMENT_NUMBER_MISMATCH
    listMISSING_METHOD_INVOCATION_EXPRESSION
    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 list.add(s[j]) 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 list.add(s[j]) 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 list.add(s[j]) 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 list.add(s[j]) is a void method call, and thus it cannot be parameterized
    6
    list.add(s[j]);
    Precondition Violations (8)
    Row Violation
    1Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression list.add(s[j]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    4Expression list.add(s[j]) is a void method call, and thus it cannot be parameterized
    5Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression list.add(s[j]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE) is a void method call, and thus it cannot be parameterized
    8Expression list.add(s[j]) is a void method call, and thus it cannot be parameterized