for (int w = 0; w < incls.length; w++) { String pattern = incls[w].replace('/', File.separatorChar) .replace('\\', File.separatorChar); if (pattern.endsWith(File.separator)) { pattern += "**"; } includePatterns.add(pattern); }
for (int w = 0; w < excls.length; w++) { String pattern = excls[w] .replace('/', File.separatorChar) .replace('\\', File.separatorChar); if (pattern.endsWith(File.separator)) { pattern += "**"; } excludePatterns.add(pattern); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Expand.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Expand.java
Method name: void extractFile(FileUtils, File, File, InputStream, String, Date, boolean, FileNameMapper) Method name: void extractFile(FileUtils, File, File, InputStream, String, Date, boolean, FileNameMapper)
Number of AST nodes: 5 Number of AST nodes: 5
1
for (int w = 0; w < incls.length; w++) {
1
for (int w = 0; w < excls.length; w++) {
2
                    String pattern = incls[w]
2
                        String pattern = excls[w]
3
.replace('/', File.separatorChar)
3
                            .replace('/', File.separatorChar)
4
                        .replace('\\', File.separatorChar);
4
                            .replace('\\', File.separatorChar);
5
                    if (pattern.endsWith(File.separator)) {
5
                        if (pattern.endsWith(File.separator)) {
6
                        pattern += "**";
6
                            pattern += "**";
7
                    }
7
                    
8
    }
8
                    includePatterns.add(pattern);
9
                        excludePatterns.add(pattern);
9
                }
10
                    }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are in the same method
Number of node comparisons16
  1. {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)5.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    for (int w = 0; w < incls.length; w++)
    11
    for (int w = 0; w < incls.length; w++)
    18
    for (int w = 0; w < excls.length; w++)
    Differences
    Expression1Expression2Difference
    inclsexclsVARIABLE_NAME_MISMATCH
    18
    for (int w = 0; w < excls.length; w++)
    12
    String pattern = incls[w].replace('/', File.separatorChar).replace('\\', File.separatorChar);
    12
    String pattern = incls[w].replace('/', File.separatorChar).replace('\\', File.separatorChar);
    19
    String pattern = excls[w].replace('/', File.separatorChar).replace('\\', File.separatorChar);
    Differences
    Expression1Expression2Difference
    inclsexclsVARIABLE_NAME_MISMATCH
    19
    String pattern = excls[w].replace('/', File.separatorChar).replace('\\', File.separatorChar);
    13
    if (pattern.endsWith(File.separator))
    20
    if (pattern.endsWith(File.separator))
    14
    pattern += "**";
    21
    pattern += "**";
    15
    includePatterns.add(pattern);
    15
    includePatterns.add(pattern);
    22
    excludePatterns.add(pattern);
    Differences
    Expression1Expression2Difference
    includePatternsexcludePatternsVARIABLE_NAME_MISMATCH
    22
    excludePatterns.add(pattern);
    Precondition Violations (0)
    Row Violation