File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/ReplaceTokens.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/ReplaceTokens.java | |||
Method name: int read()
|
Method name: int getNextChar()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (replaceIndex != -1) {↵ | 1 | if (queueIndex != -1) {↵ | |
2 | final int ch = replaceData.charAt(replaceIndex++);↵ | 2 | final int ch = queuedData.charAt(queueIndex++);↵ | |
3 | if (replaceIndex >= replaceData.length()) {↵ | 3 | if (queueIndex >= queuedData.length()) {↵ | |
4 | replaceIndex = -1;↵ | 4 | queueIndex = -1;↵ | |
5 | }↵ | 5 | }↵ | |
6 | return ch;↵ | 6 | return ch;↵ | |
7 | } | 7 |
| |
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 | 13 |
Number of mapped statements | 5 |
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) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | if (replaceIndex != -1) |
| 1 | if (queueIndex != -1) | |||||||||||||||
5 | final int ch = replaceData.charAt(replaceIndex++); |
| 2 | final int ch = queuedData.charAt(queueIndex++); | |||||||||||||||
6 | if (replaceIndex >= replaceData.length()) |
| 3 | if (queueIndex >= queuedData.length()) | |||||||||||||||
7 | replaceIndex = -1; |
| 4 | queueIndex = -1; | |||||||||||||||
8 | return ch; | 5 | return ch; |
Row | Violation |
---|---|
1 | Expression replaceIndex is a field being modified, and thus it cannot be parameterized |
2 | Expression queueIndex is a field being modified, and thus it cannot be parameterized |
3 | Expression replaceIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression queueIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression replaceIndex is a field being modified, and thus it cannot be parameterized |
6 | Expression queueIndex is a field being modified, and thus it cannot be parameterized |