while (true) { if ((zPend & 1) == 0) { sfmap[wr] = RUNA; wr++; mtfFreq[RUNA]++; } else { sfmap[wr] = RUNB; wr++; mtfFreq[RUNB]++; } if (zPend >= 2) { zPend = (zPend - 2) >> 1; } else { break; } }
zPend--; while (true) { if ((zPend & 1) == 0) { sfmap[wr] = RUNA; wr++; mtfFreq[RUNA]++; } else { sfmap[wr] = RUNB; wr++; mtfFreq[RUNB]++; } if (zPend >= 2) { zPend = (zPend - 2) >> 1; } else { break; } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java File path: /apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java
Method name: void generateMTFValues() Method name: void generateMTFValues()
Number of AST nodes: 11 Number of AST nodes: 12
1
zPend--;
1
while (true) {
2
            while (true) {
2
                        if ((zPend & 1) == 0) {
3
                if ((zPend & 1) == 0) {
3
                            sfmap[wr] = RUNA;
4
                    sfmap[wr] = RUNA;
4
                            wr++;
5
                    wr++;
5
                            mtfFreq[RUNA]++;
6
                    mtfFreq[RUNA]++;
6
                        } else {
7
                } else {
7
                            sfmap[wr] = RUNB;
8
                    sfmap[wr] = RUNB;
8
                            wr++;
9
                    
9
        
10
wr++;
10
                    mtfFreq[RUNB]++;
11
                    mtfFreq[RUNB]++;
11
                        }
12
                
12
        
13
}
13
                if (zPend >= 2) {
14
                if (zPend >= 2) {
14
                            zPend = (zPend - 2) >> 1;
15
                    zPend = (zPend - 2) >> 1;
15
                        } else {
16
                } else {
16
                            break;
17
                    break;
17
                        }
18
                
18
        
19
}
19
            }
20
            }
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.5
Clones locationClones are in the same method
Number of node comparisons90
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                            
    53
    zPend--;
    37
    while (true)
    54
    while (true)
    38
    if ((zPend & 1) == 0)
    55
    if ((zPend & 1) == 0)
    39
    sfmap[wr] = RUNA;
    56
    sfmap[wr] = RUNA;
    40
    wr++;
    57
    wr++;
    41
    mtfFreq[RUNA]++;
    58
    mtfFreq[RUNA]++;
    else
    else
    42
    sfmap[wr] = RUNB;
    59
    sfmap[wr] = RUNB;
    43
    wr++;
    60
    wr++;
    44
    mtfFreq[RUNB]++;
    61
    mtfFreq[RUNB]++;
    45
    if (zPend >= 2)
    62
    if (zPend >= 2)
    46
    zPend = (zPend - 2) >> 1;
    63
    zPend = (zPend - 2) >> 1;
    else
    else
    47
    break;
    64
    break;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables wr, mtfFreq , while Clone fragment #2 returns variables wr, mtfFreq