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 setFrom(String)
|
Method name: void setTo(String)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 6 | |||
1 | int index = from.lastIndexOf("*");↵ | 1 | int index = to.lastIndexOf("*");↵ | |
2 | if (index == -1) {↵ | 2 | if (index == -1) {↵ | |
3 | fromPrefix = from;↵ | 3 | toPrefix = to;↵ | |
4 | fromPostfix = "";↵ | 4 | toPostfix = "";↵ | |
5 | } else {↵ | 5 | } else {↵ | |
6 | fromPrefix = from.substring(0, index);↵ | 6 | toPrefix = to.substring(0, index);↵ | |
7 | fromPostfix = from.substring(index + 1);↵ | 7 | toPostfix = to.substring(index + 1);↵ | |
8 | }↵ | 8 |
| |
9 | prefixLength = fromPrefix.length();↵ | |||
10 | postfixLength = fromPostfix.length(); | |||
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 declared in the same class |
Number of node comparisons | 28 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int index = from.lastIndexOf("*"); |
| 1 | int index = to.lastIndexOf("*"); | |||||||||||||||
2 | if (index == -1) | 2 | if (index == -1) | ||||||||||||||||
3 | fromPrefix = from; |
| 3 | toPrefix = to; | |||||||||||||||
4 | fromPostfix = ""; |
| 4 | toPostfix = ""; | |||||||||||||||
else | else | ||||||||||||||||||
5 | fromPrefix = from.substring(0, index); |
| 5 | toPrefix = to.substring(0, index); | |||||||||||||||
6 | fromPostfix = from.substring(index + 1); |
| 6 | toPostfix = to.substring(index + 1); | |||||||||||||||
7 | prefixLength = fromPrefix.length(); | | |||||||||||||||||
8 | postfixLength = fromPostfix.length(); | |
Row | Violation |
---|---|
1 | Expression fromPrefix is a field being modified, and thus it cannot be parameterized |
2 | Expression toPrefix is a field being modified, and thus it cannot be parameterized |
3 | Expression fromPostfix is a field being modified, and thus it cannot be parameterized |
4 | Expression toPostfix is a field being modified, and thus it cannot be parameterized |
5 | Expression fromPrefix is a field being modified, and thus it cannot be parameterized |
6 | Expression toPrefix is a field being modified, and thus it cannot be parameterized |
7 | Expression fromPostfix is a field being modified, and thus it cannot be parameterized |
8 | Expression toPostfix is a field being modified, and thus it cannot be parameterized |