int zzi; char thech = 0; try { thech = (char)m_input.read(); } catch( IOException e ) { compressedStreamEOF(); } if( thech == -1 ) { compressedStreamEOF(); } zzi = thech; m_bsBuff = ( m_bsBuff << 8 ) | ( zzi & 0xff ); m_bsLive += 8;
char ch = 0; try { ch = (char)m_input.read(); } catch( final IOException ioe ) { compressedStreamEOF(); } if( ch == -1 ) { compressedStreamEOF(); } m_bsBuff = ( m_bsBuff << 8 ) | ( ch & 0xff ); m_bsLive += 8;
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 getAndMoveToFrontDecode() Method name: int bsR(int)
Number of AST nodes: 9 Number of AST nodes: 7
1
int zzi;
2
                            char thech = 0;
1
char ch = 0;
3
                            try
2
            try
4
                            {
3
            
5
         
4
{
6
                       thech = (char)m_input.read();
5
                ch = (char)m_input.read();
7
                            }
6
            }
8
                            catch( IOException e )
7
            catch( final IOException ioe )
9
                            {
8
            
10
               
9
{
11
                 compressedStreamEOF();
10
                compressedStreamEOF();
12
                            }
11
            
13
                
12
}
14
            if( thech == -1 )
13
            if( ch == -1 )
15
                            {
14
            {
16
                                compressedStreamEOF();
15
                compressedStreamEOF();
17
                            }
16
            
18
                            zzi = thech;
19
                
17
}
20
            m_bsBuff = ( m_bsBuff << 8 ) | ( zzi & 0xff );
18
            m_bsBuff = ( m_bsBuff << 8 ) | ( ch & 0xff );
21
                            m_bsLive += 8;
19
            m_bsLive += 8;
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.8
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    60
    int zzi;
                            
    61
    char thech = 0;
    61
    char thech = 0;
    2
    char ch = 0;
    Differences
    Expression1Expression2Difference
    thechchVARIABLE_NAME_MISMATCH
    2
    char ch = 0;
                
    3
    try
                                                          
    4
    ch = (char)m_input.read();
    Preondition Violations
    Unmatched statement ch=(char)m_input.read(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    ch = (char)m_input.read();
    62
    try
                  
    63
    thech = (char)m_input.read();
    63
    thech = (char)m_input.read();
    Preondition Violations
    Unmatched statement thech=(char)m_input.read(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                  
    64
    if (thech == -1)
    64
    if (thech == -1)
    5
    if (ch == -1)
    Differences
    Expression1Expression2Difference
    thechchVARIABLE_NAME_MISMATCH
    5
    if (ch == -1)
    65
    compressedStreamEOF();
    6
    compressedStreamEOF();
    Precondition Violations (2)
    Row Violation
    1Unmatched statement ch=(char)m_input.read(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement thech=(char)m_input.read(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted