rNToGo = (char)RAND_NUMS[ rTPos ]; rTPos++; if( rTPos == 512 ) { rTPos = 0; }
m_rNToGo = RAND_NUMS[ m_rTPos ]; m_rTPos++; if( m_rTPos == 512 ) { m_rTPos = 0; }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/CBZip2OutputStream.java File path: /jEdit-4.2/src/installer/CBZip2InputStream.java
Method name: void randomiseBlock() Method name: void setupRandPartB()
Number of AST nodes: 4 Number of AST nodes: 4
1
rNToGo = (char)RAND_NUMS[ rTPos ];
1
m_rNToGo = RAND_NUMS[ m_rTPos ];
2
                rTPos++;
2
                    m_rTPos++;
3
                if( rTPos == 512 )
3
                    if( m_rTPos == 512 )
4
                {
4
                    {
5
                    rTPos = 0;
5
                        m_rTPos = 0;
6
                }
6
                    }
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.2
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    rNToGo = (char)RAND_NUMS[rTPos];
    8
    rNToGo = (char)RAND_NUMS[rTPos];
    Preondition Violations
    Unmatched statement rNToGo=(char)RAND_NUMS[rTPos]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
                                                                    
    10
    m_rNToGo = RAND_NUMS[m_rTPos];
    Preondition Violations
    Unmatched statement m_rNToGo=RAND_NUMS[m_rTPos]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10
    m_rNToGo = RAND_NUMS[m_rTPos];
    9
    rTPos++;
    9
    rTPos++;
    11
    m_rTPos++;
    Differences
    Expression1Expression2Difference
    rTPosm_rTPosVARIABLE_NAME_MISMATCH
    11
    m_rTPos++;
    10
    if (rTPos == 512)
    10
    if (rTPos == 512)
    12
    if (m_rTPos == 512)
    Differences
    Expression1Expression2Difference
    rTPosm_rTPosVARIABLE_NAME_MISMATCH
    12
    if (m_rTPos == 512)
    11
    rTPos = 0;
    11
    rTPos = 0;
    13
    m_rTPos = 0;
    Differences
    Expression1Expression2Difference
    rTPosm_rTPosVARIABLE_NAME_MISMATCH
    13
    m_rTPos = 0;
    Precondition Violations (3)
    Row Violation
    1Unmatched statement rNToGo=(char)RAND_NUMS[rTPos]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement m_rNToGo=RAND_NUMS[m_rTPos]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Clone fragment #1 returns variables rTPos , while Clone fragment #2 returns variables