if( zPend > 0 )
{
zPend--;
while( true )
{
switch( zPend % 2 )
{
case 0:
m_szptr[ wr ] = (short)RUNA;
wr++;
m_mtfFreq[ RUNA ]++;
break;
case 1:
m_szptr[ wr ] = (short)RUNB;
wr++;
m_mtfFreq[ RUNB ]++;
break;
}
;
if( zPend < 2 )
{
break;
}
zPend = ( zPend - 2 ) / 2;
}
;
zPend = 0;
}
if( zPend > 0 )
{
zPend--;
while( true )
{
switch( zPend % 2 )
{
case 0:
m_szptr[ wr ] = (short)RUNA;
wr++;
m_mtfFreq[ RUNA ]++;
break;
case 1:
m_szptr[ wr ] = (short)RUNB;
wr++;
m_mtfFreq[ RUNB ]++;
break;
}
if( zPend < 2 )
{
break;
}
zPend = ( zPend - 2 ) / 2;
}
}
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 generateMTFValues()
|
|
Method name: void generateMTFValues()
|
Number of AST nodes: 20
|
|
Number of AST nodes: 17
|
|
1 | if( zPend > 0 )↵ | | 1 | if( zPend > 0 )↵
|
2 | {↵ | | 2 | ↵
|
3 | ↵ | | 3 | {↵
|
4 | zPend--;↵ | | 4 | zPend--;↵
|
5 | while( true )↵ | | 5 | while( true )↵
|
6 | {↵ | | 6 | ↵
|
7 | ↵ | | 7 | {↵
|
8 | switch( zPend % 2 )↵ | | 8 | switch( zPend % 2 )↵
|
9 | {↵ | | 9 | ↵
|
10 | ↵ | | 10 | {↵
|
11 | case 0:↵ | | 11 | case 0:↵
|
12 | m_szptr[ wr ] = (short)RUNA;↵ | | 12 | m_szptr[ wr ] = (short)RUNA;↵
|
13 | wr++;↵ | | 13 | wr++;↵
|
14 | m_mtfFreq[ RUNA ]++;↵ | | 14 | m_mtfFreq[ RUNA ]++;↵
|
15 | break;↵ | | 15 | break;↵
|
16 | case 1:↵ | | 16 | case 1:↵
|
17 | m_szptr[ wr ] = (short)RUNB;↵ | | 17 | m_szptr[ wr ] = (short)RUNB;↵
|
18 | wr++;↵ | | 18 | ↵
|
19 | ↵ | | 19 | wr++;↵
|
20 | m_mtfFreq[ RUNB ]++;↵ | | 20 | m_mtfFreq[ RUNB ]++;↵
|
21 | break;↵ | | 21 | ↵
|
22 | ↵ | | 22 | break;↵
|
23 | }↵ | | 23 | }↵
|
24 | ;↵ | | |
|
25 | if( zPend < 2 )↵ | | 24 | if( zPend < 2 )↵
|
26 | {↵ | | 25 | ↵
|
27 | ↵ | | 26 | {↵
|
28 | break;↵ | | 27 | break;↵
|
29 | }↵ | | 28 | ↵
|
30 | ↵ | | 29 | }↵
|
31 | zPend = ( zPend - 2 ) / 2;↵ | | 30 | zPend = ( zPend - 2 ) / 2;↵
|
32 | }↵ | | 31 | ↵
|
33 | ;↵ | | |
|
34 | zPend = 0;↵ | | |
|
35 | ↵ | | 32 | }↵
|
36 | } | | 33 | }
|
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.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 125 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 17 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 5.4 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
31 | if (zPend > 0) | | 54 | if (zPend > 0) |
32 | | | 55 | |
33 | | | 56 | |
34 | | | 57 | |
35 | | | 58 | |
36 | m_szptr[wr] = (short)RUNA; | | 59 | m_szptr[wr] = (short)RUNA; |
37 | | | 60 | |
38 | | | 61 | |
39 | | | 62 | |
40 | | | 63 | |
41 | m_szptr[wr] = (short)RUNB; | | 64 | m_szptr[wr] = (short)RUNB; |
42 | | | 65 | |
43 | | | 66 | |
44 | | | 67 | |
45 | | | | |
46 | | | 68 | |
47 | | | 69 | |
48 | | | 70 | |
49 | | | | |
50 | | | | |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched statement zPend=0; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |