for (int counter = 0; counter < excludes.length; counter++) { if (excludes[counter].equals(soughtexclude)) { return false; } }
for (int i = 0; i < arr.length; i++) { if (!couldHoldIncluded(arr[i])) { scandir(new File(basedir, arr[i]), arr[i] + File.separator, false); } }
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: boolean isMorePowerfulThanExcludes(String, String) Method name: void processSlowScan(String[])
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int counter = 0; counter < excludes.length; counter++) {
1
for (int i = 0; i < arr.length; i++) {
2
            if (excludes[counter].equals(soughtexclude))  {
2
            if (
3
                return
3
!couldHoldIncluded(arr[i])) {
4
                scandir(new File(basedir, arr[i]),
4
 false;
5
                        arr[i] + File.separator, false);
5
            }
6
            }
6
        }
7
        }
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 comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (int counter = 0; counter < excludes.length; counter++)
    2
    for (int counter = 0; counter < excludes.length; counter++)
    1
    for (int i = 0; i < arr.length; i++)
    Differences
    Expression1Expression2Difference
    counteriVARIABLE_NAME_MISMATCH
    counteriVARIABLE_NAME_MISMATCH
    excludesarrVARIABLE_NAME_MISMATCH
    counteriVARIABLE_NAME_MISMATCH
    1
    for (int i = 0; i < arr.length; i++)
    3
    if (excludes[counter].equals(soughtexclude))
    3
    if (excludes[counter].equals(soughtexclude))
    2
    if (!couldHoldIncluded(arr[i]))
    Differences
    Expression1Expression2Difference
    excludes[counter].equals(soughtexclude)!couldHoldIncluded(arr[i])TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression excludes[counter].equals(soughtexclude) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression !couldHoldIncluded(arr[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    if (!couldHoldIncluded(arr[i]))
                                                                                                                                          
    3
    scandir(new File(basedir, arr[i]), arr[i] + File.separator, false);
    Preondition Violations
    Unmatched statement scandir(new File(basedir,arr[i]),arr[i] + File.separator,false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    scandir(new File(basedir, arr[i]), arr[i] + File.separator, false);
    4
    return false;
    4
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    Precondition Violations (5)
    Row Violation
    1Expression excludes[counter].equals(soughtexclude) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression !couldHoldIncluded(arr[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement scandir(new File(basedir,arr[i]),arr[i] + File.separator,false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return false;
    5Clone fragment #1 returns variables , while Clone fragment #2 returns variables i