zz = nHeap;
tmp = heap[ zz ];
while( weights[ tmp ] < weights[ heap[ zz >> 1 ] ] )
{
heap[ zz ] = heap[ zz >> 1 ];
zz >>= 1;
}
heap[ zz ] = tmp;
zz = nHeap;
tmp = heap[ zz ];
while( weights[ tmp ] < weights[ heap[ zz >> 1 ] ] )
{
heap[ zz ] = heap[ zz >> 1 ];
zz >>= 1;
}
heap[ zz ] = tmp;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/CBZip2OutputStream.java
|
|
File path: /jEdit-4.2/src/installer/CBZip2OutputStream.java
|
Method name: void hbMakeCodeLengths(char[], int[], int, int)
|
|
Method name: void hbMakeCodeLengths(char[], int[], int, int)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | zz = nHeap;↵ | | 1 | zz = nHeap;↵
|
2 | tmp = heap[ zz ];↵ | | 2 | tmp = heap[ zz ];↵
|
3 | while( weights[ tmp ] < weights[ heap[ zz >> 1 ] ] )↵ | | 3 | while( weights[ tmp ] < weights[ heap[ zz >> 1 ] ] )↵
|
4 | {↵ | | 4 | {↵
|
5 | heap[ zz ] = heap[ zz >> 1 ];↵ | | 5 | heap[ zz ] = heap[ zz >> 1 ];↵
|
6 | zz >>= 1;↵ | | 6 | zz >>= 1;↵
|
7 | }↵ | | 7 | }↵
|
8 | heap[ zz ] = tmp; | | 8 | 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) | 0.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 26 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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 |
26 | zz = nHeap; | | 85 | zz = nHeap; |
27 | tmp = heap[zz]; | | 86 | tmp = heap[zz]; |
28 | while (weights[tmp] < weights[heap[zz >> 1]]) | | 87 | while (weights[tmp] < weights[heap[zz >> 1]]) |
29 | heap[zz] = heap[zz >> 1]; | | 88 | heap[zz] = heap[zz >> 1]; |
30 | | | 89 | |
31 | heap[zz] = tmp; | | 90 | heap[zz] = tmp; |
Precondition Violations (0)
Row |
Violation |