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;
}
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;
}
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: 10
|
|
Number of AST nodes: 10
|
|
1 | while (true) {↵ | | 1 | while (true) {↵
|
2 | yy = zz << 1;↵ | | 2 | yy = zz << 1;↵
|
|
3 | if (yy > nHeap) {↵ | | 3 | if (yy > nHeap) {↵
|
4 | break;↵ | | 4 | break;↵
|
5 | }↵ | | 5 | }↵
|
|
6 | if ((yy < nHeap)↵ | | 6 | if ((yy < nHeap)↵
|
7 | && (weight[heap[yy + 1]] < weight[heap[yy]])) {↵ | | 7 | && (weight[heap[yy + 1]] < weight[heap[yy]])) {↵
|
8 | yy++;↵ | | 8 | yy++;↵
|
9 | }↵ | | 9 | }↵
|
|
10 | if (weight[tmp] < weight[heap[yy]]) {↵ | | 10 | if (weight[tmp] < weight[heap[yy]]) {↵
|
11 | break;↵ | | 11 | break;↵
|
12 | }↵ | | 12 | }↵
|
|
13 | heap[zz] = heap[yy];↵ | | 13 | heap[zz] = heap[yy];↵
|
14 | zz = yy;↵ | | 14 | zz = yy;↵
|
15 | } | | 15 | }
|
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 in the same method |
Number of node comparisons | 45 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 10 |
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) | 2.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
47 | while (true) | | 30 | while (true) |
48 | | | 31 | |
49 | | | 32 | |
50 | | | 33 | |
51 | if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) | | 34 | if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) |
52 | | | 35 | |
53 | if (weight[tmp] < weight[heap[yy]]) | | 36 | if (weight[tmp] < weight[heap[yy]]) |
54 | | | 37 | |
55 | | | 38 | |
56 | | | 39 | |
Precondition Violations (0)
Row |
Violation |