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"); } }
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"); } }
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: int getAndMoveToFrontDecode0(int) Method name: void getAndMoveToFrontDecode()
Number of AST nodes: 7 Number of AST nodes: 7
1
while (bsLiveShadow < 1) {
1
while (bsLiveShadow < zn) {
2
                final int thech = inShadow.read();
2
                    final int thech = inShadow.read();
3
                if (thech >= 0) {
3
                    if (thech >= 0) {
4
                    bsBuffShadow = (bsBuffShadow << 8) | thech;
4
                        bsBuffShadow = (bsBuffShadow << 8) | thech;
5
                    bsLiveShadow += 8;
5
                        bsLiveShadow += 8;
6
                    continue;
6
                        continue;
7
                } else {
7
                    } else {
8
                    throw new IOException("unexpected end of stream");
8
                        throw new IOException("unexpected end of stream");
9
                }
9
                
10
    }
10
            }
11
                }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons32
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    while (bsLiveShadow < 1)
    11
    while (bsLiveShadow < 1)
    94
    while (bsLiveShadow < zn)
    Differences
    Expression1Expression2Difference
    1znTYPE_COMPATIBLE_REPLACEMENT
    94
    while (bsLiveShadow < zn)
    12
    final int thech = inShadow.read();
    95
    final int thech = inShadow.read();
    13
    if (thech >= 0)
    96
    if (thech >= 0)
    14
    bsBuffShadow = (bsBuffShadow << 8) | thech;
    97
    bsBuffShadow = (bsBuffShadow << 8) | thech;
    15
    bsLiveShadow += 8;
    98
    bsLiveShadow += 8;
    16
    continue;
    99
    continue;
    else
    else
    17
    throw new IOException("unexpected end of stream");
    100
    throw new IOException("unexpected end of stream");
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables bsLiveShadow, bsBuffShadow , while Clone fragment #2 returns variables bsBuffShadow, bsLiveShadow