while (bsLiveShadow < zn) {
final int thech = inShadow.read();
if (thech >= 0) {
bsBuffShadow = (bsBuffShadow << 8) | thech;
bsLiveShadow += 8;
continue;
} else {
throw new IOException("unexpected end of stream");
}
}
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");
}
}
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: 7
|
|
Number of AST nodes: 7
|
|
1 | while (bsLiveShadow < zn) {↵ | | 1 | while (bsLiveShadow < 1) {↵
|
2 | final int thech = inShadow.read();↵ | | 2 | final int thech = inShadow.read();↵
|
3 | ↵ | | |
|
4 | if (thech >= 0) {↵ | | 3 | if (thech >= 0) {↵
|
5 | bsBuffShadow = (bsBuffShadow << 8) | thech;↵ | | 4 | bsBuffShadow = (bsBuffShadow << 8) | thech;↵
|
6 | bsLiveShadow += 8;↵ | | 5 | bsLiveShadow += 8;↵
|
7 | continue;↵ | | 6 | continue;↵
|
8 | } else {↵ | | 7 | } else {↵
|
9 | throw new IOException("unexpected end of stream");↵ | | 8 | throw new IOException("unexpected end of stream");↵
|
10 | }↵ | | 9 | ↵
|
11 | ↵ | | 10 | }↵
|
12 | } | | 11 | }
|
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 declared in the same class |
Number of node comparisons | 34 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
48 | while (bsLiveShadow < zn) | | 11 | while (bsLiveShadow < 1) |
49 | final int thech = inShadow.read(); | | 12 | final int thech = inShadow.read(); |
50 | | | 13 | |
51 | bsBuffShadow = (bsBuffShadow << 8) | thech; | | 14 | bsBuffShadow = (bsBuffShadow << 8) | thech; |
52 | | | 15 | |
53 | | | 16 | |
| | | | |
54 | throw new IOException("unexpected end of stream"); | | 17 | throw new IOException("unexpected end of stream"); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables bsBuffShadow, bsLiveShadow , while Clone fragment #2 returns variables bsLiveShadow, bsBuffShadow |