zn++;
while (bsLiveShadow < 1) {
final int thech = inShadow.read();
if (thech >= 0) {
bsBuffShadow = (bsBuffShadow << 8) | thech;
bsLiveShadow += 8;
continue;
} else {
throw new IOException("unexpected end of stream");
}
}
bsLiveShadow--;
zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1);
zn++;
while (bsLiveShadow < 1) {
final int thech = inShadow.read();
if (thech >= 0) {
bsBuffShadow = (bsBuffShadow << 8) | thech;
bsLiveShadow += 8;
continue;
} else {
throw new IOException("unexpected end of stream");
}
}
bsLiveShadow--;
zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2InputStream.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2InputStream.java
|
Method name: void getAndMoveToFrontDecode()
|
|
Method name: int getAndMoveToFrontDecode0(int)
|
Number of AST nodes: 10
|
|
Number of AST nodes: 10
|
|
1 | zn++;↵ | | 1 | zn++;↵
|
2 | while (bsLiveShadow < 1) {↵ | | 2 | while (bsLiveShadow < 1) {↵
|
3 | final int thech = inShadow.read();↵ | | 3 | final int thech = inShadow.read();↵
|
4 | ↵ | | |
|
5 | if (thech >= 0) {↵ | | 4 | if (thech >= 0) {↵
|
6 | bsBuffShadow = (bsBuffShadow << 8) | thech;↵ | | 5 | bsBuffShadow = (bsBuffShadow << 8) | thech;↵
|
7 | bsLiveShadow += 8;↵ | | 6 | bsLiveShadow += 8;↵
|
8 | continue;↵ | | 7 | continue;↵
|
9 | } else {↵ | | 8 | ↵
|
10 | ↵ | | 9 | } else {↵
|
11 | throw new IOException("unexpected end of stream");↵ | | 10 | throw new IOException("unexpected end of stream");↵
|
12 | }↵ | | 11 | }↵
|
13 | }↵ | | 12 | ↵
|
14 | ↵ | | 13 | }↵
|
15 | bsLiveShadow--;↵ | | 14 | bsLiveShadow--;↵
|
16 | zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1); | | 15 | zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1);
|
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 declared in the same class |
Number of node comparisons | 49 |
-
{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) | 5.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
58 | zn++; | | 10 | zn++; |
59 | while (bsLiveShadow < 1) | | 11 | while (bsLiveShadow < 1) |
60 | final int thech = inShadow.read(); | | 12 | final int thech = inShadow.read(); |
61 | | | 13 | |
62 | bsBuffShadow = (bsBuffShadow << 8) | thech; | | 14 | bsBuffShadow = (bsBuffShadow << 8) | thech; |
63 | | | 15 | |
64 | | | 16 | |
| | | | |
65 | throw new IOException("unexpected end of stream"); | | 17 | throw new IOException("unexpected end of stream"); |
66 | bsLiveShadow--; | | 18 | bsLiveShadow--; |
67 | zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1); | | 19 | zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables bsLiveShadow, bsBuffShadow, zn, zvec , while Clone fragment #2 returns variables zn, zvec, bsLiveShadow, bsBuffShadow |