File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java | File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java | |||
Method name: void hbMakeCodeLengths(char[], int[], int, int)
|
Method name: void hbMakeCodeLengths(byte[], int[], Data, int, int)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | int j = 0;↵ | 1 | int j = 0;↵ | |
2 | int k = i;↵ | 2 | int k = i;↵ | |
3 | for (int parent_k; (parent_k = parent[k]) >= 0;) {↵ | 3 | for (int parent_k; (parent_k = parent[k]) >= 0;) {↵ | |
4 | k = parent_k;↵ | 4 | k = parent_k;↵ | |
5 | j++;↵ | 5 | j++;↵ | |
6 | }↵ | 6 | }↵ | |
7 | len[i - 1] = (char) j;↵ | 7 | len[i - 1] = (byte) j;↵ | |
8 | if (j > maxLen) {↵ | 8 | if (j > maxLen) {↵ | |
9 | tooLong = true;↵ | 9 | tooLong = true;↵ | |
10 | } | 10 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 43 |
Number of mapped statements | 7 |
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) | 2.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
75 | int j = 0; | 75 | int j = 0; | ||||
76 | int k = i; | 76 | int k = i; | ||||
77 | for (int parent_k; (parent_k = parent[k]) >= 0; ) | 77 | for (int parent_k; (parent_k = parent[k]) >= 0; ) | ||||
78 | k = parent_k; | 78 | k = parent_k; | ||||
79 | j++; | 79 | j++; | ||||
|
| 80 | len[i - 1] = (byte)j; | ||||
80 | len[i - 1] = (char)j; |
| | ||||
81 | if (j > maxLen) | 81 | if (j > maxLen) | ||||
82 | tooLong = true; | 82 | tooLong = true; |
Row | Violation |
---|---|
1 | Unmatched statement len[i - 1]=(byte)j; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement len[i - 1]=(char)j; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Clone fragment #1 returns variables tooLong, j , while Clone fragment #2 returns variables tooLong, j |