int zz = 0;
int yy = 0;
int tmp = 0;
zz = 1;
tmp = heap[ zz ];
while( true )
{
yy = zz << 1;
if( yy > nHeap )
{
break;
}
if( yy < nHeap &&
weights[ heap[ yy + 1 ] ] < weights[ heap[ yy ] ] )
{
yy++;
}
if( weights[ tmp ] < weights[ heap[ yy ] ] )
{
break;
}
heap[ zz ] = heap[ yy ];
zz = yy;
}
heap[ zz ] = tmp;
int zz = 0;
int yy = 0;
int tmp = 0;
zz = 1;
tmp = heap[ zz ];
while( true )
{
yy = zz << 1;
if( yy > nHeap )
{
break;
}
if( yy < nHeap &&
weights[ heap[ yy + 1 ] ] < weights[ heap[ yy ] ] )
{
yy++;
}
if( weights[ tmp ] < weights[ heap[ yy ] ] )
{
break;
}
heap[ zz ] = heap[ yy ];
zz = yy;
}
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: 16
|
|
Number of AST nodes: 16
|
|
1 | int zz = 0;↵ | | 1 | int zz = 0;↵
|
2 | int yy = 0;↵ | | 2 | int yy = 0;↵
|
3 | int tmp = 0;↵ | | 3 | int tmp = 0;↵
|
4 | zz = 1;↵ | | 4 | zz = 1;↵
|
5 | tmp = heap[ zz ];↵ | | 5 | tmp = heap[ zz ];↵
|
6 | while( true )↵ | | 6 | while( true )↵
|
7 | {↵ | | 7 | {↵
|
8 | yy = zz << 1;↵ | | 8 | yy = zz << 1;↵
|
9 | if( yy > nHeap )↵ | | 9 | if( yy > nHeap )↵
|
10 | {↵ | | 10 | {↵
|
11 | break;↵ | | 11 | break;↵
|
12 | }↵ | | 12 | }↵
|
13 | if( yy < nHeap &&↵ | | 13 | if( yy < nHeap &&↵
|
14 | weights[ heap[ yy + 1 ] ] < weights[ heap[ yy ] ] )↵ | | 14 | weights[ heap[ yy + 1 ] ] < weights[ heap[ yy ] ] )↵
|
15 | {↵ | | 15 | {↵
|
16 | yy++;↵ | | 16 | yy++;↵
|
17 | }↵ | | 17 | }↵
|
18 | if( weights[ tmp ] < weights[ heap[ yy ] ] )↵ | | 18 | if( weights[ tmp ] < weights[ heap[ yy ] ] )↵
|
19 | {↵ | | 19 | {↵
|
20 | break;↵ | | 20 | break;↵
|
21 | }↵ | | 21 | }↵
|
22 | heap[ zz ] = heap[ yy ];↵ | | 22 | heap[ zz ] = heap[ yy ];↵
|
23 | zz = yy;↵ | | 23 | zz = yy;↵
|
24 | }↵ | | 24 | }↵
|
25 | heap[ zz ] = tmp; | | 25 | 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) | 3.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 82 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 16 |
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) | 23.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
57 | int zz = 0; | | 38 | int zz = 0; |
58 | int yy = 0; | | 39 | int yy = 0; |
59 | int tmp = 0; | | 40 | int tmp = 0; |
60 | zz = 1; | | 41 | zz = 1; |
61 | tmp = heap[zz]; | | 42 | tmp = heap[zz]; |
62 | while (true) | | 43 | while (true) |
63 | | | 44 | |
64 | | | 45 | |
65 | | | 46 | |
66 | if (yy < nHeap && weights[heap[yy + 1]] < weights[heap[yy]]) | | 47 | if (yy < nHeap && weights[heap[yy + 1]] < weights[heap[yy]]) |
67 | | | 48 | |
68 | if (weights[tmp] < weights[heap[yy]]) | | 49 | if (weights[tmp] < weights[heap[yy]]) |
69 | | | 50 | |
70 | | | 51 | |
71 | | | 52 | |
72 | heap[zz] = tmp; | | 53 | heap[zz] = tmp; |
Precondition Violations (0)
Row |
Violation |