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 | } | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 6 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 18 | File exclFile = p.resolveFile(fileName); | |||||||||||
31 | File f = ((FileResource)o).getFile(); |
| | |||||||||||
32 | if (FILE_UTILS.fileNameEquals(f, destinationFile)) |
| 19 | if (!exclFile.exists()) | ||||||||||
|
| 20 | throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found."); | |||||||||||
33 | throw new BuildException("Input file \"" + f + "\" is the same as the output file."); |
| |
Row | Violation |
---|---|
1 | 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 |
2 | 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 |
3 | Unmatched throw new BuildException("Excludesfile " + exclFile.getAbsolutePath() + " not found."); |
4 | Unmatched throw new BuildException("Input file \"" + f + "\" is the same as the output file."); |