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
                } else {
10
                            throw new IOException("unexpected end of stream");
9
                    throw new IOException("unexpected end of stream");
11
                        }
10
                }
12
                    }
11
            
13
        
12
}
14
            bsLiveShadow--;
13
            bsLiveShadow--;
15
                    zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1);
14
            zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1);
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 comparisons47
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.9
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    104
    zn++;
    10
    zn++;
    105
    while (bsLiveShadow < 1)
    11
    while (bsLiveShadow < 1)
    106
    final int thech = inShadow.read();
    12
    final int thech = inShadow.read();
    107
    if (thech >= 0)
    13
    if (thech >= 0)
    108
    bsBuffShadow = (bsBuffShadow << 8) | thech;
    14
    bsBuffShadow = (bsBuffShadow << 8) | thech;
    109
    bsLiveShadow += 8;
    15
    bsLiveShadow += 8;
    110
    continue;
    16
    continue;
    else
    else
    111
    throw new IOException("unexpected end of stream");
    17
    throw new IOException("unexpected end of stream");
    112
    bsLiveShadow--;
    18
    bsLiveShadow--;
    113
    zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1);
    19
    zvec = (zvec << 1) | ((bsBuffShadow >> bsLiveShadow) & 1);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables bsLiveShadow, bsBuffShadow, zn, zvec , while Clone fragment #2 returns variables zn, zvec, bsLiveShadow, bsBuffShadow