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;
}
}
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: 12
|
|
Number of AST nodes: 12
|
|
1 | zPend--;↵ | | 1 | zPend--;↵
|
2 | while (true) {↵ | | 2 | while (true) {↵
|
3 | if ((zPend & 1) == 0) {↵ | | 3 | if ((zPend & 1) == 0) {↵
|
4 | sfmap[wr] = RUNA;↵ | | 4 | sfmap[wr] = RUNA;↵
|
5 | wr++;↵ | | 5 | wr++;↵
|
6 | mtfFreq[RUNA]++;↵ | | 6 | mtfFreq[RUNA]++;↵
|
7 | } else {↵ | | 7 | } else {↵
|
8 | sfmap[wr] = RUNB;↵ | | 8 | sfmap[wr] = RUNB;↵
|
9 | wr++;↵ | | 9 | wr++;↵
|
10 | mtfFreq[RUNB]++;↵ | | 10 | mtfFreq[RUNB]++;↵
|
11 | }↵ | | 11 | }↵
|
|
12 | if (zPend >= 2) {↵ | | 12 | if (zPend >= 2) {↵
|
13 | zPend = (zPend - 2) >> 1;↵ | | 13 | zPend = (zPend - 2) >> 1;↵
|
14 | } else {↵ | | 14 | } else {↵
|
15 | break;↵ | | 15 | break;↵
|
16 | }↵ | | 16 | ↵
|
17 | ↵ | | 17 | }↵
|
18 | } | | 18 | }
|
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 | 91 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 12 |
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.5 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
36 | zPend--; | | 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 |