if( j2 < z ) { m_currentChar = ch2; m_crc.updateCRC( ch2 ); j2++; } else { m_currentState = RAND_PART_A_STATE; i2++; count = 0; setupRandPartA(); }
if( j2 < z ) { m_currentChar = ch2; m_crc.updateCRC( ch2 ); j2++; } else { m_currentState = NO_RAND_PART_A_STATE; i2++; count = 0; setupNoRandPartA(); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/CBZip2InputStream.java File path: /jEdit-4.2/src/installer/CBZip2InputStream.java
Method name: void setupRandPartC() Method name: void setupNoRandPartC()
Number of AST nodes: 8 Number of AST nodes: 8
1
if( j2 < z )
1
if( j2 < z )
2
        {
2
        {
3
            m_currentChar = ch2;
3
            m_currentChar = ch2;
4
            m_crc.updateCRC( ch2 );
4
            m_crc.updateCRC( ch2 );
5
            j2++;
5
            j2++;
6
        }
6
        }
7
        else
7
        else
8
        {
8
        {
9
            m_currentState = RAND_PART_A_STATE;
9
            m_currentState = NO_RAND_PART_A_STATE;
10
            i2++;
10
            i2++;
11
            count = 0;
11
            count = 0;
12
            setupRandPartA();
12
            setupNoRandPartA();
13
        }
13
        }
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 declared in the same class
Number of node comparisons64
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (j2 < z)
    1
    if (j2 < z)
    2
    m_currentChar = ch2;
    2
    m_currentChar = ch2;
    3
    m_crc.updateCRC(ch2);
    3
    m_crc.updateCRC(ch2);
    4
    j2++;
    4
    j2++;
    else
    else
    5
    m_currentState = RAND_PART_A_STATE;
    5
    m_currentState = RAND_PART_A_STATE;
    5
    m_currentState = NO_RAND_PART_A_STATE;
    Differences
    Expression1Expression2Difference
    RAND_PART_A_STATENO_RAND_PART_A_STATEVARIABLE_NAME_MISMATCH
    5
    m_currentState = NO_RAND_PART_A_STATE;
    6
    i2++;
    6
    i2++;
    7
    count = 0;
    7
    count = 0;
    8
    setupRandPartA();
    8
    setupRandPartA();
    8
    setupNoRandPartA();
    Differences
    Expression1Expression2Difference
    setupRandPartAsetupNoRandPartAMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setupRandPartA() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method setupRandPartA
    Expression setupNoRandPartA() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method setupNoRandPartA
    Expression setupRandPartA() is a void method call, and thus it cannot be parameterized
    Expression setupNoRandPartA() is a void method call, and thus it cannot be parameterized
    8
    setupNoRandPartA();
    Precondition Violations (4)
    Row Violation
    1Expression setupRandPartA() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression setupNoRandPartA() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression setupRandPartA() is a void method call, and thus it cannot be parameterized
    4Expression setupNoRandPartA() is a void method call, and thus it cannot be parameterized