zPend--; while( true ) { switch( zPend % 2 ) { case 0: m_szptr[ wr ] = (short)RUNA; wr++; m_mtfFreq[ RUNA ]++; break; case 1: m_szptr[ wr ] = (short)RUNB; wr++; m_mtfFreq[ RUNB ]++; break; } ; if( zPend < 2 ) { break; } zPend = ( zPend - 2 ) / 2; } ; zPend = 0;
zPend--; while( true ) { switch( zPend % 2 ) { case 0: m_szptr[ wr ] = (short)RUNA; wr++; m_mtfFreq[ RUNA ]++; break; case 1: m_szptr[ wr ] = (short)RUNB; wr++; m_mtfFreq[ RUNB ]++; break; } if( zPend < 2 ) { break; } zPend = ( zPend - 2 ) / 2; }
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 generateMTFValues() Method name: void generateMTFValues()
Number of AST nodes: 19 Number of AST nodes: 16
1
zPend--;
1
zPend--;
2
                    while( true )
2
            while( true )
3
                    {
3
            {
4
                        switch( zPend % 2 )
4
                switch( zPend % 2 )
5
                        {
5
                {
6
                            case 0:
6
                    case 0:
7
                                m_szptr[ wr ] = (short)RUNA;
7
                        m_szptr[ wr ] = (short)RUNA;
8
                                wr++;
8
                        
9
      
9
wr++;
10
                          m_mtfFreq[ RUNA ]++;
10
                        m_mtfFreq[ RUNA ]++;
11
                                break;
11
                        break;
12
                            case 1:
12
                    case 1:
13
                                m_szptr[ wr ] = (short)RUNB;
13
                        m_szptr[ wr ] = (short)RUNB;
14
                                wr++;
14
                        wr++;
15
                                m_mtfFreq[ RUNB ]++;
15
                        m_mtfFreq[ RUNB ]++;
16
                                break;
16
                        break;
17
                        }
17
                
18
                        ;
19
        
18
}
20
                if( zPend < 2 )
19
                if( zPend < 2 )
21
                        {
20
                
22
        
21
{
23
                    break;
22
                    break;
24
                        }
23
                
25
        
24
}
26
                zPend = ( zPend - 2 ) / 2;
25
                zPend = ( zPend - 2 ) / 2;
27
                    }
26
            
28
                    ;
29
                    zPend = 0;
27
}
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 comparisons121
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)12.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    32
    zPend--;
    55
    zPend--;
    33
    while (true)
    56
    while (true)
    34
    switch (zPend % 2)
    57
    switch (zPend % 2)
    35
    case 0:
    58
    case 0:
    36
    m_szptr[wr] = (short)RUNA;
    59
    m_szptr[wr] = (short)RUNA;
    37
    wr++;
    60
    wr++;
    38
    m_mtfFreq[RUNA]++;
    61
    m_mtfFreq[RUNA]++;
    39
    break;
    62
    break;
    40
    case 1:
    63
    case 1:
    41
    m_szptr[wr] = (short)RUNB;
    64
    m_szptr[wr] = (short)RUNB;
    42
    wr++;
    65
    wr++;
    43
    m_mtfFreq[RUNB]++;
    66
    m_mtfFreq[RUNB]++;
    44
    break;
    67
    break;
    45
    ;
              
    46
    if (zPend < 2)
    68
    if (zPend < 2)
    47
    break;
    69
    break;
    48
    zPend = (zPend - 2) / 2;
    70
    zPend = (zPend - 2) / 2;
    49
    ;
              
    50
    zPend = 0;
    50
    zPend = 0;
    Preondition Violations
    Unmatched statement zPend=0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                            
    Precondition Violations (1)
    Row Violation
    1Unmatched statement zPend=0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted