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;
}
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;
}
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: 11
|
|
Number of AST nodes: 11
|
|
1 | switch( zPend % 2 )↵ | | 1 | switch( zPend % 2 )↵
|
2 | {↵ | | 2 | ↵
|
3 | ↵ | | 3 | {↵
|
4 | case 0:↵ | | 4 | case 0:↵
|
5 | m_szptr[ wr ] = (short)RUNA;↵ | | 5 | m_szptr[ wr ] = (short)RUNA;↵
|
6 | wr++;↵ | | 6 | ↵
|
7 | ↵ | | 7 | wr++;↵
|
8 | m_mtfFreq[ RUNA ]++;↵ | | 8 | m_mtfFreq[ RUNA ]++;↵
|
9 | break;↵ | | 9 | break;↵
|
10 | case 1:↵ | | 10 | ↵
|
11 | ↵ | | 11 | case 1:↵
|
12 | m_szptr[ wr ] = (short)RUNB;↵ | | 12 | m_szptr[ wr ] = (short)RUNB;↵
|
13 | wr++;↵ | | 13 | wr++;↵
|
14 | m_mtfFreq[ RUNB ]++;↵ | | 14 | m_mtfFreq[ RUNB ]++;↵
|
15 | break;↵ | | 15 | ↵
|
16 | ↵ | | 16 | break;↵
|
17 | } | | 17 | }
|
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.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 85 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 11 |
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) | 3.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
34 | switch (zPend % 2) | | 57 | switch (zPend % 2) |
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 | |
Precondition Violations (0)
Row |
Violation |