if (includes == null) { this.includes = null; } else { this.includes = new String[includes.length]; for (int i = 0; i < includes.length; i++) { this.includes[i] = normalizePattern(includes[i]); } }
if (excludes == null) { this.excludes = null; } else { this.excludes = new String[excludes.length]; for (int i = 0; i < excludes.length; i++) { this.excludes[i] = normalizePattern(excludes[i]); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/DirectoryScanner.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/DirectoryScanner.java
Method name: void setIncludes(String[]) Method name: void setExcludes(String[])
Number of AST nodes: 5 Number of AST nodes: 5
1
if (includes == null) {
1
if (excludes == null) {
2
            this.includes = null;
2
            this.excludes = null;
3
        } else {
3
        } else {
4
            this.includes = new String[includes.length];
4
            this.excludes = new String[excludes.length];
5
            for (int i = 0; i < includes.length; i++) {
5
            for (int i = 0; i < excludes.length; i++) {
6
                this.includes[i] = normalizePattern(includes[i]);
6
                this.excludes[i] = normalizePattern(excludes[i]);
7
            }
7
            }
8
        }
8
        }
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 comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (includes == null)
    1
    if (includes == null)
    1
    if (excludes == null)
    Differences
    Expression1Expression2Difference
    includesexcludesVARIABLE_NAME_MISMATCH
    1
    if (excludes == null)
    2
    this.includes = null;
    2
    this.includes = null;
    2
    this.excludes = null;
    Differences
    Expression1Expression2Difference
    includesexcludesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.includes is a field being modified, and thus it cannot be parameterized
    Expression this.excludes is a field being modified, and thus it cannot be parameterized
    2
    this.excludes = null;
    else
    else
    3
    this.includes = new String[includes.length];
    3
    this.includes = new String[includes.length];
    3
    this.excludes = new String[excludes.length];
    Differences
    Expression1Expression2Difference
    includesexcludesVARIABLE_NAME_MISMATCH
    includesexcludesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.includes is a field being modified, and thus it cannot be parameterized
    Expression this.excludes is a field being modified, and thus it cannot be parameterized
    3
    this.excludes = new String[excludes.length];
    4
    for (int i = 0; i < includes.length; i++)
    4
    for (int i = 0; i < includes.length; i++)
    4
    for (int i = 0; i < excludes.length; i++)
    Differences
    Expression1Expression2Difference
    includesexcludesVARIABLE_NAME_MISMATCH
    4
    for (int i = 0; i < excludes.length; i++)
    5
    this.includes[i] = normalizePattern(includes[i]);
    5
    this.includes[i] = normalizePattern(includes[i]);
    5
    this.excludes[i] = normalizePattern(excludes[i]);
    Differences
    Expression1Expression2Difference
    includesexcludesVARIABLE_NAME_MISMATCH
    includesexcludesVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.includes cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.excludes cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    this.excludes[i] = normalizePattern(excludes[i]);
    Precondition Violations (6)
    Row Violation
    1Expression this.includes is a field being modified, and thus it cannot be parameterized
    2Expression this.excludes is a field being modified, and thus it cannot be parameterized
    3Expression this.includes is a field being modified, and thus it cannot be parameterized
    4Expression this.excludes is a field being modified, and thus it cannot be parameterized
    5Expression this.includes cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression this.excludes cannot be parameterized, because it has dependencies to/from statements that will be extracted