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;
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: 9
|
|
Number of AST nodes: 9
|
|
1 | yy = zz << 1;↵ | | 1 | yy = zz << 1;↵
|
|
2 | if (yy > nHeap) {↵ | | 2 | if (yy > nHeap) {↵
|
3 | break;↵ | | 3 | break;↵
|
4 | }↵ | | 4 | }↵
|
|
5 | if ((yy < nHeap)↵ | | 5 | if ((yy < nHeap)↵
|
6 | && (weight[heap[yy + 1]] < weight[heap[yy]])) {↵ | | 6 | && (weight[heap[yy + 1]] < weight[heap[yy]])) {↵
|
7 | yy++;↵ | | 7 | yy++;↵
|
8 | }↵ | | 8 | }↵
|
|
9 | if (weight[tmp] < weight[heap[yy]]) {↵ | | 9 | if (weight[tmp] < weight[heap[yy]]) {↵
|
10 | break;↵ | | 10 | break;↵
|
11 | }↵ | | 11 | }↵
|
|
12 | heap[zz] = heap[yy];↵ | | 12 | heap[zz] = heap[yy];↵
|
13 | zz = yy; | | 13 | zz = yy;
|
See real code fragment |
|
See real code fragment |
Summary
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) | 1.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 39 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 9 |
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.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
31 | yy = zz << 1; | | 48 | yy = zz << 1; |
32 | if (yy > nHeap) | | 49 | if (yy > nHeap) |
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 | heap[zz] = heap[yy]; | | 55 | heap[zz] = heap[yy]; |
39 | zz = yy; | | 56 | zz = yy; |
Precondition Violations (5)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |
3 | Statement break; without innermost loop |
4 | Statement break; without innermost loop |
5 | Clone fragment #1 returns variables zz, heap , while Clone fragment #2 returns variables zz, heap |