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