int zz; int tmp; zz = nHeap; tmp = heap[ zz ]; while( weights[ tmp ] < weights[ heap[ zz >> 1 ] ] ) { heap[ zz ] = heap[ zz >> 1 ]; zz >>= 1; } heap[ zz ] = tmp;
int zz = 0; int tmp = 0; 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: 8 Number of AST nodes: 8
1
int zz;
1
int zz = 0;
2
                    int tmp;
2
                    int tmp = 0;
3
                    zz = nHeap;
3
                    zz = nHeap;
4
                    tmp = heap[ zz ];
4
                    tmp = heap[ zz ];
5
                    while( weights[ tmp ] < weights[ heap[ zz >> 1 ] ] )
5
                    while( weights[ tmp ] < weights[ heap[ zz >> 1 ] ] )
6
                    {
6
                    {
7
                        heap[ zz ] = heap[ zz >> 1 ];
7
                        heap[ zz ] = heap[ zz >> 1 ];
8
                        zz >>= 1;
8
                        zz >>= 1;
9
                    }
9
                    }
10
                    heap[ zz ] = tmp;
10
                    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)0.3
Clones locationClones are in the same method
Number of node comparisons42
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    24
    int zz;
    24
    int zz;
    Preondition Violations
    Unmatched statement int zz; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                          
    25
    int tmp;
    25
    int tmp;
    Preondition Violations
    Unmatched statement int tmp; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                            
                              
    83
    int zz = 0;
    Preondition Violations
    Unmatched statement int zz=0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    83
    int zz = 0;
                                
    84
    int tmp = 0;
    Preondition Violations
    Unmatched statement int tmp=0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    84
    int tmp = 0;
    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
    zz >>= 1;
    89
    zz >>= 1;
    31
    heap[zz] = tmp;
    90
    heap[zz] = tmp;
    Precondition Violations (4)
    Row Violation
    1Unmatched statement int zz; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement int tmp; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement int zz=0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement int tmp=0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted