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;
n1 = 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;
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
n2 = heap[ 1 ];
1
n1 = heap[ 1 ];
2
                heap[ 1 ] = heap[ nHeap ];
2
                heap[ 1 ] = heap[ nHeap ];
3
                nHeap--;
3
                nHeap--;
4
                {
4
                {
5
                    int zz = 0;
5
                    int zz = 0;
6
                    int yy = 0;
6
                    int yy = 0;
7
                    int tmp = 0;
7
                    int tmp = 0;
8
                    zz = 1;
8
                    zz = 1;
9
                    tmp = heap[ zz ];
9
                    tmp = heap[ zz ];
10
                    while( true )
10
                    while( true )
11
                    {
11
                    {
12
                        yy = zz << 1;
12
                        yy = zz << 1;
13
                        if( yy > nHeap )
13
                        if( yy > nHeap )
14
                        {
14
                        {
15
                            break;
15
                            break;
16
                        }
16
                        }
17
                        if( yy < nHeap &&
17
                        if( yy < nHeap &&
18
                            weights[ heap[ yy + 1 ] ] < weights[ heap[ yy ] ] )
18
                            weights[ heap[ yy + 1 ] ] < weights[ heap[ yy ] ] )
19
                        {
19
                        {
20
                            yy++;
20
                            yy++;
21
                        }
21
                        }
22
                        if( weights[ tmp ] < weights[ heap[ yy ] ] )
22
                        if( weights[ tmp ] < weights[ heap[ yy ] ] )
23
                        {
23
                        {
24
                            break;
24
                            break;
25
                        }
25
                        }
26
                        heap[ zz ] = heap[ yy ];
26
                        heap[ zz ] = heap[ yy ];
27
                        zz = yy;
27
                        zz = yy;
28
                    }
28
                    }
29
                    heap[ zz ] = tmp;
29
                    heap[ zz ] = tmp;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)1.0
Clones locationClones are in the same method
Number of node comparisons82
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 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
    yy = zz << 1;
    44
    yy = zz << 1;
    64
    if (yy > nHeap)
    45
    if (yy > nHeap)
    65
    break;
    46
    break;
    66
    if (yy < nHeap && weights[heap[yy + 1]] < weights[heap[yy]])
    47
    if (yy < nHeap && weights[heap[yy + 1]] < weights[heap[yy]])
    67
    yy++;
    48
    yy++;
    68
    if (weights[tmp] < weights[heap[yy]])
    49
    if (weights[tmp] < weights[heap[yy]])
    69
    break;
    50
    break;
    70
    heap[zz] = heap[yy];
    51
    heap[zz] = heap[yy];
    71
    zz = yy;
    52
    zz = yy;
    72
    heap[zz] = tmp;
    53
    heap[zz] = tmp;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables , while Clone fragment #2 returns variables heap