if (excludesFileList.size() > 0) { Enumeration e = excludesFileList.elements(); while (e.hasMoreElements()) { NameEntry ne = (NameEntry) e.nextElement(); String fileName = ne.evalName(p); if (fileName != null) { File exclFile = p.resolveFile(fileName); if (!exclFile.exists()) { throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found."); } readPatterns(exclFile, excludeList, p); } } excludesFileList.removeAllElements(); }
if (includesFileList.size() > 0) { Enumeration e = includesFileList.elements(); while (e.hasMoreElements()) { NameEntry ne = (NameEntry) e.nextElement(); String fileName = ne.evalName(p); if (fileName != null) { File inclFile = p.resolveFile(fileName); if (!inclFile.exists()) { throw new BuildException("Includesfile " + inclFile.getAbsolutePath() + " not found."); } readPatterns(inclFile, includeList, p); } } includesFileList.removeAllElements(); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/PatternSet.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/PatternSet.java
Method name: void readFiles(Project) Method name: void readFiles(Project)
Number of AST nodes: 11 Number of AST nodes: 11
1
if (excludesFileList.size() > 0) {
1
if (includesFileList.size() > 0) {
2
            Enumeration e = excludesFileList.elements();
2
            Enumeration e = includesFileList.elements();
3
            while (e.hasMoreElements()) {
3
            while (e.hasMoreElements()) {
4
                NameEntry ne = (NameEntry) e.nextElement();
4
                NameEntry ne = (NameEntry) e.nextElement();
5
                String fileName = ne.evalName(p);
5
                String fileName = ne.evalName(p);
6
                if (fileName != null) {
6
                if (fileName != null) {
7
                    File exclFile = p.resolveFile(fileName);
7
                    File inclFile = p.resolveFile(fileName);
8
                    if (!exclFile.exists()) {
8
                    if (!inclFile.exists()) {
9
                        throw new BuildException("Excludesfile "
9
                        throw new BuildException("Includesfile "
10
                                                 + exclFile.getAbsolutePath()
10
                                                 + inclFile.getAbsolutePath()
11
                                                 + " not found.");
11
                                                 + " not found.");
12
                    }
12
                    }
13
                    readPatterns(exclFile, excludeList, p);
13
                    readPatterns(inclFile, includeList, p);
14
                }
14
                }
15
            }
15
            }
16
            excludesFileList.removeAllElements();
16
            includesFileList.removeAllElements();
17
        }
17
        }
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.3
Clones locationClones are in the same method
Number of node comparisons31
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    if (excludesFileList.size() > 0)
    12
    if (excludesFileList.size() > 0)
    1
    if (includesFileList.size() > 0)
    Differences
    Expression1Expression2Difference
    excludesFileListincludesFileListVARIABLE_NAME_MISMATCH
    1
    if (includesFileList.size() > 0)
    13
    Enumeration e = excludesFileList.elements();
    13
    Enumeration e = excludesFileList.elements();
    2
    Enumeration e = includesFileList.elements();
    Differences
    Expression1Expression2Difference
    excludesFileListincludesFileListVARIABLE_NAME_MISMATCH
    2
    Enumeration e = includesFileList.elements();
    14
    while (e.hasMoreElements())
    3
    while (e.hasMoreElements())
    15
    NameEntry ne = (NameEntry)e.nextElement();
    4
    NameEntry ne = (NameEntry)e.nextElement();
    16
    String fileName = ne.evalName(p);
    5
    String fileName = ne.evalName(p);
    17
    if (fileName != null)
    6
    if (fileName != null)
    18
    File exclFile = p.resolveFile(fileName);
    18
    File exclFile = p.resolveFile(fileName);
    7
    File inclFile = p.resolveFile(fileName);
    Differences
    Expression1Expression2Difference
    exclFileinclFileVARIABLE_NAME_MISMATCH
    7
    File inclFile = p.resolveFile(fileName);
    19
    if (!exclFile.exists())
    19
    if (!exclFile.exists())
    8
    if (!inclFile.exists())
    Differences
    Expression1Expression2Difference
    exclFileinclFileVARIABLE_NAME_MISMATCH
    8
    if (!inclFile.exists())
    20
    throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found.");
    20
    throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found.");
    9
    throw new BuildException("Includesfile " + inclFile.getAbsolutePath() + " not found.");
    Differences
    Expression1Expression2Difference
    "Excludesfile ""Includesfile "LITERAL_VALUE_MISMATCH
    exclFileinclFileVARIABLE_NAME_MISMATCH
    9
    throw new BuildException("Includesfile " + inclFile.getAbsolutePath() + " not found.");
    21
    readPatterns(exclFile, excludeList, p);
    21
    readPatterns(exclFile, excludeList, p);
    10
    readPatterns(inclFile, includeList, p);
    Differences
    Expression1Expression2Difference
    exclFileinclFileVARIABLE_NAME_MISMATCH
    excludeListincludeListVARIABLE_NAME_MISMATCH
    10
    readPatterns(inclFile, includeList, p);
    22
    excludesFileList.removeAllElements();
    22
    excludesFileList.removeAllElements();
    11
    includesFileList.removeAllElements();
    Differences
    Expression1Expression2Difference
    excludesFileListincludesFileListVARIABLE_NAME_MISMATCH
    11
    includesFileList.removeAllElements();
    Precondition Violations (0)
    Row Violation