while (true) {
yy = zz << 1;
if (yy > nHeap) {
break;
}
if ((yy < nHeap)
&& (weight[heap[yy + 1]] < weight[heap[yy]])) {
yy++;
}
if (weight[tmp] < weight[heap[yy]]) {
break;
}
heap[zz] = heap[yy];
zz = yy;
}
heap[zz] = tmp;
tmp = heap[1];
while (true) {
yy = zz << 1;
if (yy > nHeap) {
break;
}
if ((yy < nHeap)
&& (weight[heap[yy + 1]] < weight[heap[yy]])) {
yy++;
}
if (weight[tmp] < weight[heap[yy]]) {
break;
}
heap[zz] = heap[yy];
zz = yy;
}
heap[zz] = tmp;
Clone fragments detected by clone detection tool
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(char[], int[], int, int)
|
Number of AST nodes: 11
|
|
Number of AST nodes: 12
|
|
| | | 1 | tmp = heap[1];↵
|
|
1 | while (true) {↵ | | 2 | while (true) {↵
|
2 | yy = zz << 1;↵ | | 3 | yy = zz << 1;↵
|
|
3 | if (yy > nHeap) {↵ | | 4 | if (yy > nHeap) {↵
|
4 | break;↵ | | 5 | break;↵
|
5 | }↵ | | 6 | }↵
|
|
6 | if ((yy < nHeap)↵ | | 7 | if ((yy < nHeap)↵
|
7 | && (weight[heap[yy + 1]] < weight[heap[yy]])) {↵ | | 8 | && (weight[heap[yy + 1]] < weight[heap[yy]])) {↵
|
8 | yy++;↵ | | 9 | yy++;↵
|
9 | }↵ | | 10 | }↵
|
|
10 | if (weight[tmp] < weight[heap[yy]]) {↵ | | 11 | if (weight[tmp] < weight[heap[yy]]) {↵
|
11 | break;↵ | | 12 | break;↵
|
12 | }↵ | | 13 | }↵
|
|
13 | heap[zz] = heap[yy];↵ | | 14 | heap[zz] = heap[yy];↵
|
14 | zz = yy;↵ | | 15 | zz = yy;↵
|
15 | }↵ | | 16 | }↵
|
|
16 | heap[zz] = tmp; | | 17 | heap[zz] = tmp;
|
See real code fragment |
|
See real code fragment |
Summary
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) | 1.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 41 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 14.6 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 46 | tmp = heap[1]; |
30 | while (true) | | 47 | while (true) |
31 | | | 48 | |
32 | | | 49 | |
33 | | | 50 | |
34 | if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) | | 51 | if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) |
35 | | | 52 | |
36 | if (weight[tmp] < weight[heap[yy]]) | | 53 | if (weight[tmp] < weight[heap[yy]]) |
37 | | | 54 | |
38 | | | 55 | |
39 | | | 56 | |
40 | heap[zz] = tmp; | | 57 | heap[zz] = tmp; |
Precondition Violations (0)
Row |
Violation |