byte tmp = pos[0];
int j = 0;
while (ll_i != tmp) {
j++;
byte tmp2 = tmp;
tmp = pos[j];
pos[j] = tmp2;
}
pos[0] = tmp;
byte tmp = yy[0];
int j = 0;
while (ll_i != tmp) {
j++;
byte tmp2 = tmp;
tmp = yy[j];
yy[j] = tmp2;
}
yy[0] = tmp;
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 sendMTFValues2(int, int)
|
|
Method name: void generateMTFValues()
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | byte tmp = pos[0];↵ | | 1 | byte tmp = yy[0];↵
|
2 | int j = 0;↵ | | 2 | int j = 0;↵
|
|
3 | while (ll_i != tmp) {↵ | | 3 | while (ll_i != tmp) {↵
|
4 | j++;↵ | | 4 | j++;↵
|
5 | byte tmp2 = tmp;↵ | | 5 | byte tmp2 = tmp;↵
|
6 | tmp = pos[j];↵ | | 6 | tmp = yy[j];↵
|
7 | pos[j] = tmp2;↵ | | 7 | yy[j] = tmp2;↵
|
8 | }↵ | | 8 | }↵
|
|
9 | pos[0] = tmp; | | 9 | yy[0] = tmp;
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 42 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 9.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | byte tmp = pos[0]; | | 25 | byte tmp = yy[0]; |
8 | int j = 0; | | 26 | int j = 0; |
9 | while (ll_i != tmp) | | 27 | while (ll_i != tmp) |
10 | | | 28 | |
11 | | | 29 | |
12 | | | 30 | |
13 | | | 31 | |
14 | pos[0] = tmp; | | 32 | yy[0] = tmp; |
Precondition Violations (0)
Row |
Violation |