if ((zPend & 1) == 0) {
sfmap[wr] = RUNA;
wr++;
mtfFreq[RUNA]++;
} else {
sfmap[wr] = RUNB;
wr++;
mtfFreq[RUNB]++;
}
if (zPend >= 2) {
zPend = (zPend - 2) >> 1;
} else {
break;
}
if ((zPend & 1) == 0) {
sfmap[wr] = RUNA;
wr++;
mtfFreq[RUNA]++;
} else {
sfmap[wr] = RUNB;
wr++;
mtfFreq[RUNB]++;
}
if (zPend >= 2) {
zPend = (zPend - 2) >> 1;
} else {
break;
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java
|
Method name: void generateMTFValues()
|
|
Method name: void generateMTFValues()
|
Number of AST nodes: 10
|
|
Number of AST nodes: 10
|
|
1 | if ((zPend & 1) == 0) {↵ | | 1 | if ((zPend & 1) == 0) {↵
|
2 | sfmap[wr] = RUNA;↵ | | 2 | sfmap[wr] = RUNA;↵
|
3 | wr++;↵ | | 3 | wr++;↵
|
4 | mtfFreq[RUNA]++;↵ | | 4 | mtfFreq[RUNA]++;↵
|
5 | } else {↵ | | 5 | } else {↵
|
6 | sfmap[wr] = RUNB;↵ | | 6 | sfmap[wr] = RUNB;↵
|
7 | wr++;↵ | | 7 | wr++;↵
|
8 | mtfFreq[RUNB]++;↵ | | 8 | mtfFreq[RUNB]++;↵
|
9 | }↵ | | 9 | }↵
|
|
10 | if (zPend >= 2) {↵ | | 10 | if (zPend >= 2) {↵
|
11 | zPend = (zPend - 2) >> 1;↵ | | 11 | zPend = (zPend - 2) >> 1;↵
|
12 | } else {↵ | | 12 | } else {↵
|
13 | break;↵ | | 13 | break;↵
|
14 | } | | 14 | }
|
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 | 89 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 10 |
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) | 2.5 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
38 | if ((zPend & 1) == 0) | | 55 | if ((zPend & 1) == 0) |
39 | | | 56 | |
40 | | | 57 | |
41 | | | 58 | |
| | | | |
42 | | | 59 | |
43 | | | 60 | |
44 | | | 61 | |
45 | if (zPend >= 2) | | 62 | if (zPend >= 2) |
46 | zPend = (zPend - 2) >> 1; | | 63 | zPend = (zPend - 2) >> 1; |
| | | | |
47 | | | 64 | |
Precondition Violations (3)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |
3 | Clone fragment #1 returns variables wr, mtfFreq, zPend , while Clone fragment #2 returns variables wr, mtfFreq, zPend |