if (destinationFile != null) { for (Iterator i = rc.iterator(); i.hasNext();) { Object o = i.next(); if (o instanceof FileResource) { File f = ((FileResource) o).getFile(); if (FILE_UTILS.fileNameEquals(f, destinationFile)) { throw new BuildException("Input file \"" + f + "\" is the same as the output file."); } } } }
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); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Concat.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/PatternSet.java
Method name: ResourceCollection validate() Method name: void readFiles(Project)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (destinationFile != null) {
1
NameEntry ne = 
2
                for (Iterator i = rc.iterator(); i.hasNext();) {
2
(NameEntry) e.nextElement();
3
                    Object o = i.next();
3
                
4
   
4
String fileName = ne.evalName(p);
5
                 if (o instanceof FileResource) {
5
                if (
6
                        File f = ((FileResource) o).getFile();
7
                        if (FILE_UTILS.fileNameEquals(f, destinationFile
6
fileName != null) {
7
                    File exclFile = p.resolveFile(fileName);
8
)) {
8
                    if (!exclFile.exists()) {
9
                            throw new BuildException("Input file \""
9
                        throw new BuildException("Excludesfile "
10
                                + f + "\" is the same as the output file.");
10
                                
11
                        }
12
                    }
13
                }
11
                 + exclFile.getAbsolutePath()
12
                                                 + " not found.");
13
                    }
14
                    readPatterns(exclFile, excludeList, p);
14
            }
15
                }
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                        
    18
    File exclFile = p.resolveFile(fileName);
    Preondition Violations
    Unmatched statement File exclFile=p.resolveFile(fileName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    18
    File exclFile = p.resolveFile(fileName);
    31
    File f = ((FileResource)o).getFile();
    31
    File f = ((FileResource)o).getFile();
    Preondition Violations
    Unmatched statement File f=((FileResource)o).getFile(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                  
    32
    if (FILE_UTILS.fileNameEquals(f, destinationFile))
    32
    if (FILE_UTILS.fileNameEquals(f, destinationFile))
    19
    if (!exclFile.exists())
    Differences
    Expression1Expression2Difference
    FILE_UTILS.fileNameEquals(f,destinationFile)!exclFile.exists()TYPE_COMPATIBLE_REPLACEMENT
    19
    if (!exclFile.exists())
                                                                                                                                                                                          
    20
    throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found.");
    Preondition Violations
    Unmatched throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found.");
    20
    throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found.");
    33
    throw new BuildException("Input file \"" + f + "\" is the same as the output file.");
    33
    throw new BuildException("Input file \"" + f + "\" is the same as the output file.");
    Preondition Violations
    Unmatched throw new BuildException("Input file \"" + f + "\" is the same as the output file.");
                                                                                                                                                                                      
    Precondition Violations (4)
    Row Violation
    1Unmatched statement File exclFile=p.resolveFile(fileName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement File f=((FileResource)o).getFile(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found.");
    4Unmatched throw new BuildException("Input file \"" + f + "\" is the same as the output file.");