while (true) {
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;
}
}
zPend--;
while (true) {
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: 11
|
|
Number of AST nodes: 12
|
|
| | | 1 | zPend--;↵
|
1 | while (true) {↵ | | 2 | while (true) {↵
|
2 | if ((zPend & 1) == 0) {↵ | | 3 | if ((zPend & 1) == 0) {↵
|
3 | sfmap[wr] = RUNA;↵ | | 4 | sfmap[wr] = RUNA;↵
|
4 | wr++;↵ | | 5 | wr++;↵
|
5 | mtfFreq[RUNA]++;↵ | | 6 | mtfFreq[RUNA]++;↵
|
6 | } else {↵ | | 7 | } else {↵
|
7 | sfmap[wr] = RUNB;↵ | | 8 | sfmap[wr] = RUNB;↵
|
8 | wr++;↵ | | 9 | ↵
|
9 | ↵ | | 10 | wr++;↵
|
10 | mtfFreq[RUNB]++;↵ | | 11 | mtfFreq[RUNB]++;↵
|
11 | }↵ | | 12 | ↵
|
|
12 | ↵ | | 13 | }↵
|
|
13 | if (zPend >= 2) {↵ | | 14 | if (zPend >= 2) {↵
|
14 | zPend = (zPend - 2) >> 1;↵ | | 15 | zPend = (zPend - 2) >> 1;↵
|
15 | } else {↵ | | 16 | } else {↵
|
16 | break;↵ | | 17 | break;↵
|
17 | }↵ | | 18 | ↵
|
18 | ↵ | | 19 | }↵
|
19 | } | | 20 | }
|
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.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 90 |
-
{Non-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 | 1 |
Time elapsed for statement mapping (ms) | 3.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 53 | zPend--; |
37 | while (true) | | 54 | while (true) |
38 | | | 55 | |
39 | | | 56 | |
40 | | | 57 | |
41 | | | 58 | |
| | | | |
42 | | | 59 | |
43 | | | 60 | |
44 | | | 61 | |
45 | | | 62 | |
46 | zPend = (zPend - 2) >> 1; | | 63 | zPend = (zPend - 2) >> 1; |
| | | | |
47 | | | 64 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables wr, mtfFreq , while Clone fragment #2 returns variables wr, mtfFreq |