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;
|
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 | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
60 | int zzi; | | | |
61 | char thech = 0; | | 2 | char ch = 0; |
| | | 3 | try |
| | | 4 | ch = (char)m_input.read(); |
62 | try | | | |
63 | thech = (char)m_input.read(); | | | |
64 | if (thech == -1) | | 5 | if (ch == -1) |
65 | | | 6 | |
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 |