m_nInUse = 0; for( int i = 0; i < 256; i++ ) { if( m_inUse[ i ] ) { m_seqToUnseq[ m_nInUse ] = (char)i; m_unseqToSeq[ i ] = (char)m_nInUse; m_nInUse++; } }
int i; m_nInUse = 0; for( i = 0; i < 256; i++ ) { if( m_inUse[ i ] ) { m_seqToUnseq[ m_nInUse ] = (char)i; m_unseqToSeq[ i ] = (char)m_nInUse; m_nInUse++; } }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/CBZip2InputStream.java File path: /jEdit-4.2/src/installer/CBZip2OutputStream.java
Method name: void makeMaps() Method name: void makeMaps()
Number of AST nodes: 6 Number of AST nodes: 7
1
int i;
1
m_nInUse = 0;
2
        m_nInUse = 0;
2
        for( int i = 0; i < 256; i++ )
3
        for( i = 0; i < 256; i++ )
3
        {
4
        {
4
            if( m_inUse[ i ] )
5
            if( m_inUse[ i ] )
5
            {
6
            {
6
                m_seqToUnseq[ m_nInUse ] = (char)i;
7
                m_seqToUnseq[ m_nInUse ] = (char)i;
7
                m_unseqToSeq[ i ] = (char)m_nInUse;
8
                m_unseqToSeq[ i ] = (char)m_nInUse;
8
                m_nInUse++;
9
                m_nInUse++;
9
            }
10
            }
10
        }
11
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are in different classes
Number of node comparisons17
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    3
    if (m_inUse[i])
    4
    if (m_inUse[i])
    4
    m_seqToUnseq[m_nInUse] = (char)i;
    5
    m_seqToUnseq[m_nInUse] = (char)i;
    5
    m_unseqToSeq[i] = (char)m_nInUse;
    6
    m_unseqToSeq[i] = (char)m_nInUse;
    6
    m_nInUse++;
    7
    m_nInUse++;
    Precondition Violations (0)
    Row Violation