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;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | char ch = 0; | | 27 | char thech = 0; |
3 | try | | | |
4 | ch = (char)m_input.read(); | | | |
| | | 26 | int zzi; |
| | | 28 | try |
| | | 29 | thech = (char)m_input.read(); |
5 | if (ch == -1) | | 30 | if (thech == -1) |
6 | | | 31 | |
Precondition Violations (2)
Row |
Violation |
1 | 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 |
2 | 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 |