while( m_bsLive >= 8 )
{
int ch = ( m_bsBuff >> 24 );
try
{
m_bsStream.write( ch );// write 8-bit
}
catch( IOException e )
{
throw e;
}
m_bsBuff <<= 8;
m_bsLive -= 8;
}
m_bsBuff |= ( v << ( 32 - m_bsLive - n ) );
m_bsLive += n;
while( m_bsLive > 0 )
{
int ch = ( m_bsBuff >> 24 );
try
{
m_bsStream.write( ch );// write 8-bit
}
catch( IOException e )
{
throw e;
}
m_bsBuff <<= 8;
m_bsLive -= 8;
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/CBZip2OutputStream.java
|
|
File path: /jEdit-4.2/src/installer/CBZip2OutputStream.java
|
Method name: void bsW(int, int)
|
|
Method name: void bsFinishedWithStream()
|
Number of AST nodes: 8
|
|
Number of AST nodes: 6
|
|
1 | while( m_bsLive >= 8 )↵ | | 1 | while( m_bsLive > 0 )↵
|
2 | {↵ | | 2 | {↵
|
3 | int ch = ( m_bsBuff >> 24 );↵ | | 3 | int ch = ( m_bsBuff >> 24 );↵
|
4 | try↵ | | 4 | try↵
|
5 | {↵ | | 5 | {↵
|
6 | m_bsStream.write( ch );// write 8-bit↵ | | 6 | m_bsStream.write( ch );// write 8-bit↵
|
7 | }↵ | | 7 | }↵
|
8 | catch( IOException e )↵ | | 8 | catch( IOException e )↵
|
9 | {↵ | | 9 | {↵
|
10 | throw e;↵ | | 10 | throw e;↵
|
11 | }↵ | | 11 | }↵
|
12 | m_bsBuff <<= 8;↵ | | 12 | m_bsBuff <<= 8;↵
|
13 | m_bsLive -= 8;↵ | | 13 | m_bsLive -= 8;↵
|
14 | }↵ | | 14 | }
|
15 | m_bsBuff |= ( v << ( 32 - m_bsLive - n ) );↵ | | | |
16 | m_bsLive += n; | | | |
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 6 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | int ch = (m_bsBuff >> 24); | | 2 | int ch = (m_bsBuff >> 24); |
3 | try | | 3 | try |
4 | | | 4 | |
Precondition Violations (0)
Row |
Violation |