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;
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;
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: int bsR(int) Method name: void getAndMoveToFrontDecode()
Number of AST nodes: 7 Number of AST nodes: 9
1
int zzi;
1
char ch = 0;
2
                char thech = 0;
2
            try
3
                try
3
            {
4
                {
4
                ch = (char)m_input.read();
5
                    thech = (char)m_input.read();
5
            }
6
            
7
    }
6
            catch( final IOException ioe )
8
                catch( IOException e )
7
            {
9
            
10
    {
8
                compressedStreamEOF();
11
                    compressedStreamEOF();
9
            }
12
            
13
    }
10
            if( ch == -1 )
14
                if( thech == -1 )
11
            {
15
                {
12
                compressedStreamEOF();
16
                    compressedStreamEOF();
13
            }
17
            
18
    }
19
                zzi = thech;
14
            m_bsBuff = ( m_bsBuff << 8 ) | ( ch & 0xff );
20
                m_bsBuff = ( m_bsBuff << 8 ) | ( zzi & 0xff );
15
            m_bsLive += 8;
21
                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 fragment2
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    char ch = 0;
    2
    char ch = 0;
    27
    char thech = 0;
    Differences
    Expression1Expression2Difference
    chthechVARIABLE_NAME_MISMATCH
    27
    char thech = 0;
    3
    try
                
    4
    ch = (char)m_input.read();
    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
                                                          
                            
    26
    int zzi;
                  
    28
    try
                                                                  
    29
    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
    29
    thech = (char)m_input.read();
    5
    if (ch == -1)
    5
    if (ch == -1)
    30
    if (thech == -1)
    Differences
    Expression1Expression2Difference
    chthechVARIABLE_NAME_MISMATCH
    30
    if (thech == -1)
    6
    compressedStreamEOF();
    31
    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