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 | String fileName = ne.evalName(p);↵ | |
4 | if (o instanceof FileResource) {↵ | 4 | if (↵ | |
5 | File f = ((FileResource) o).getFile();↵ | |||
6 | if (FILE_UTILS.fileNameEquals(f, destinationFile↵ | 5 | fileName != null) {↵ | |
6 | File inclFile = p.resolveFile(fileName);↵ | |||
7 | )) {↵ | 7 | if (!inclFile.exists()) {↵ | |
8 | throw new BuildException("Input file \""↵ | 8 | throw new BuildException("Includesfile "↵ | |
9 | + f + "\" is the same as the output file.");↵ | 9 | ↵ | |
10 | }↵ | |||
11 | }↵ | |||
12 | }↵ | |||
10 | + inclFile.getAbsolutePath()↵ | |||
11 | + " not found.");↵ | |||
12 | }↵ | |||
13 | readPatterns(inclFile, includeList, p);↵ | |||
13 | } | 14 | } | |
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.2 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 7 | File inclFile = p.resolveFile(fileName); | |||||||||||
31 | File f = ((FileResource)o).getFile(); |
| | |||||||||||
32 | if (FILE_UTILS.fileNameEquals(f, destinationFile)) |
| 8 | if (!inclFile.exists()) | ||||||||||
|
| 9 | throw new BuildException("Includesfile " + inclFile.getAbsolutePath() + " not found."); | |||||||||||
33 | throw new BuildException("Input file \"" + f + "\" is the same as the output file."); |
| |
Row | Violation |
---|---|
1 | Unmatched statement File inclFile=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("Includesfile " + inclFile.getAbsolutePath() + " not found."); |
4 | Unmatched throw new BuildException("Input file \"" + f + "\" is the same as the output file."); |