File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/GlobPatternMapper.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/GlobPatternMapper.java | |||
Method name: void setTo(String)
|
Method name: void setFrom(String)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | int index = to.lastIndexOf("*");↵ | 1 | int index = from.lastIndexOf("*");↵ | |
2 | if (index == -1) {↵ | 2 | if (index == -1) {↵ | |
3 | toPrefix = to;↵ | 3 | fromPrefix = from;↵ | |
4 | toPostfix = "";↵ | 4 | fromPostfix = "";↵ | |
5 | } else {↵ | 5 | } else {↵ | |
6 | toPrefix = to.substring(0, index);↵ | 6 | fromPrefix = from.substring(0, index);↵ | |
7 | toPostfix = to.substring(index + 1);↵ | 7 | fromPostfix = from.substring(index + 1);↵ | |
8 | } | 8 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int index = to.lastIndexOf("*"); |
| 1 | int index = from.lastIndexOf("*"); | |||||||||||||
2 | if (index == -1) | 2 | if (index == -1) | ||||||||||||||
3 | toPrefix = to; |
| 3 | fromPrefix = from; | |||||||||||||
4 | toPostfix = ""; |
| 4 | fromPostfix = ""; | |||||||||||||
else | else | ||||||||||||||||
5 | toPrefix = to.substring(0, index); |
| 5 | fromPrefix = from.substring(0, index); | |||||||||||||
6 | toPostfix = to.substring(index + 1); |
| 6 | fromPostfix = from.substring(index + 1); |
Row | Violation |
---|