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;
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(byte[], int[], Data, int, int)
|
Number of AST nodes: 12
|
|
Number of AST nodes: 12
|
|
1 | tmp = heap[1];↵ | | 1 | tmp = heap[1];↵
|
|
2 | while (true) {↵ | | 2 | while (true) {↵
|
3 | yy = zz << 1;↵ | | 3 | yy = zz << 1;↵
|
|
4 | if (yy > nHeap) {↵ | | 4 | if (yy > nHeap) {↵
|
5 | break;↵ | | 5 | break;↵
|
6 | }↵ | | 6 | }↵
|
|
7 | if ((yy < nHeap)↵ | | 7 | if ((yy < nHeap)↵
|
8 | && (weight[heap[yy + 1]] < weight[heap[yy]])) {↵ | | 8 | && (weight[heap[yy + 1]] < weight[heap[yy]])) {↵
|
9 | yy++;↵ | | 9 | yy++;↵
|
10 | }↵ | | 10 | }↵
|
|
11 | if (weight[tmp] < weight[heap[yy]]) {↵ | | 11 | if (weight[tmp] < weight[heap[yy]]) {↵
|
12 | break;↵ | | 12 | break;↵
|
13 | }↵ | | 13 | }↵
|
|
14 | heap[zz] = heap[yy];↵ | | 14 | heap[zz] = heap[yy];↵
|
15 | zz = yy;↵ | | 15 | zz = yy;↵
|
16 | }↵ | | 16 | }↵
|
|
17 | 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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 45 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 12 |
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) | 20.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
46 | tmp = heap[1]; | | 46 | tmp = heap[1]; |
47 | while (true) | | 47 | while (true) |
48 | | | 48 | |
49 | | | 49 | |
50 | | | 50 | |
51 | if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) | | 51 | if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) |
52 | | | 52 | |
53 | if (weight[tmp] < weight[heap[yy]]) | | 53 | if (weight[tmp] < weight[heap[yy]]) |
54 | | | 54 | |
55 | | | 55 | |
56 | | | 56 | |
57 | heap[zz] = tmp; | | 57 | heap[zz] = tmp; |
Precondition Violations (0)
Row |
Violation |