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: void getAndMoveToFrontDecode()
|
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 | if (thech >= 0) {↵ | | 4 | if (thech >= 0) {↵
|
5 | bsBuffShadow = (bsBuffShadow << 8) | thech;↵ | | 5 | bsBuffShadow = (bsBuffShadow << 8) | thech;↵
|
6 | bsLiveShadow += 8;↵ | | 6 | bsLiveShadow += 8;↵
|
7 | continue;↵ | | 7 | continue;↵
|
8 | } else {↵ | | 8 | } else {↵
|
9 | throw new IOException("unexpected end of stream");↵ | | 9 | throw new IOException("unexpected end of stream");↵
|
10 | }↵ | | 10 | ↵
|
11 | ↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
13 | bsLiveShadow--;↵ | | 13 | bsLiveShadow--;↵
|
14 | zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1); | | 14 | 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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 65 |
-
{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) | 27.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
58 | zn++; | | 104 | zn++; |
59 | while (bsLiveShadow < 1) | | 105 | while (bsLiveShadow < 1) |
60 | final int thech = inShadow.read(); | | 106 | final int thech = inShadow.read(); |
61 | | | 107 | |
62 | bsBuffShadow = (bsBuffShadow << 8) | thech; | | 108 | bsBuffShadow = (bsBuffShadow << 8) | thech; |
63 | | | 109 | |
64 | | | 110 | |
| | | | |
65 | throw new IOException("unexpected end of stream"); | | 111 | throw new IOException("unexpected end of stream"); |
66 | bsLiveShadow--; | | 112 | bsLiveShadow--; |
67 | zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1); | | 113 | 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 bsLiveShadow, bsBuffShadow, zn, zvec |