if (environment != null) { for (int i = 0; i < environment.length; i++) { log("Setting environment variable: " + environment[i], Project.MSG_VERBOSE); } }
if (nestedExcludes != null) { for (int i = 0; i < nestedExcludes.length; i++) { createExclude().setName(nestedExcludes[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/PatternSet.java
Method name: Execute prepareExec() Method name: void addConfiguredPatternset(PatternSet)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (environment != null) {
1
if (nestedExcludes != null) {
2
            for (int i = 0; i < environment.length; i++) {
2
            for (int i = 0; i < nestedExcludes.length; i++) {
3
                log("Setting environment variable: " + environment[i],
3
                
4
                    Project.MSG_VERBOSE);
4
createExclude().setName(nestedExcludes[i]);
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 having the same super class
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)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    if (environment != null)
    11
    if (environment != null)
    8
    if (nestedExcludes != null)
    Differences
    Expression1Expression2Difference
    environmentnestedExcludesVARIABLE_NAME_MISMATCH
    8
    if (nestedExcludes != null)
    12
    for (int i = 0; i < environment.length; i++)
    12
    for (int i = 0; i < environment.length; i++)
    9
    for (int i = 0; i < nestedExcludes.length; i++)
    Differences
    Expression1Expression2Difference
    environmentnestedExcludesVARIABLE_NAME_MISMATCH
    9
    for (int i = 0; i < nestedExcludes.length; i++)
    13
    log("Setting environment variable: " + environment[i], Project.MSG_VERBOSE);
    13
    log("Setting environment variable: " + environment[i], Project.MSG_VERBOSE);
    10
    createExclude().setName(nestedExcludes[i]);
    Differences
    Expression1Expression2Difference
    logsetNameMETHOD_INVOCATION_NAME_MISMATCH
    log("Setting environment variable: " + environment[i],Project.MSG_VERBOSE)createExclude().setName(nestedExcludes[i])ARGUMENT_NUMBER_MISMATCH
    createExclude()MISSING_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 createExclude().setName(nestedExcludes[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 createExclude().setName(nestedExcludes[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 createExclude().setName(nestedExcludes[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 createExclude().setName(nestedExcludes[i]) is a void method call, and thus it cannot be parameterized
    10
    createExclude().setName(nestedExcludes[i]);
    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 createExclude().setName(nestedExcludes[i]) 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 createExclude().setName(nestedExcludes[i]) 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 createExclude().setName(nestedExcludes[i]) 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 createExclude().setName(nestedExcludes[i]) is a void method call, and thus it cannot be parameterized