File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/MappingSelector.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/PresentSelector.java | |||
Method name: boolean isSelected(File, String, File)
|
Method name: boolean isSelected(File, String, File)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | String[] destfiles = map.mapFileName(filename);↵ | 1 | String[] destfiles = map.mapFileName(filename);↵ | |
2 | // If filename does not match the To attribute of the mapper↵ | 2 | // If filename does not match the To attribute of the mapper↵ | |
3 | // then filter it out of the files we are considering↵ | 3 | // then filter it out of the files we are considering↵ | |
4 | if (destfiles == null) {↵ | 4 | if (destfiles == null) {↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | }↵ | 6 | }↵ | |
7 | // Sanity check↵ | 7 | // Sanity check↵ | |
8 | if (destfiles.length != 1 || destfiles[0] == null) {↵ | 8 | if (destfiles.length != 1 || destfiles[0] == null) {↵ | |
9 | throw new BuildException("Invalid destination file results for "↵ | 9 | throw new BuildException("Invalid destination file results for "↵ | |
10 | + targetdir.getName() + " with filename " + filename);↵ | 10 | + targetdir + " with filename " + filename);↵ | |
11 | }↵ | 11 | }↵ | |
12 | String destname = destfiles[0];↵ | 12 | String destname = destfiles[0];↵ | |
13 | File destfile = new File(targetdir, destname); | 13 |
| |
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 18 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
2 | String[] destfiles = map.mapFileName(filename); | 2 | String[] destfiles = map.mapFileName(filename); | ||||
3 | if (destfiles == null) | 3 | if (destfiles == null) | ||||
4 | return false; | 4 | return false; | ||||
5 | if (destfiles.length != 1 || destfiles[0] == null) | 5 | if (destfiles.length != 1 || destfiles[0] == null) | ||||
|
| 6 | throw new BuildException("Invalid destination file results for " + targetdir + " with filename " + filename); | ||||
6 | throw new BuildException("Invalid destination file results for " + targetdir.getName() + " with filename " + filename); |
| | ||||
7 | String destname = destfiles[0]; | 7 | String destname = destfiles[0]; | ||||
8 | File destfile = new File(targetdir, destname); | 8 | File destfile = new File(targetdir, destname); |
Row | Violation |
---|---|
1 | Unmatched throw new BuildException("Invalid destination file results for " + targetdir + " with filename "+ filename); |
2 | Unmatched throw new BuildException("Invalid destination file results for " + targetdir.getName() + " with filename "+ filename); |