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; } }
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: 12 Number of AST nodes: 12
1
zPend--;
1
zPend--;
2
                    while (true) {
2
            while (true) {
3
                        if ((zPend & 1) == 0) {
3
                if ((zPend & 1) == 0) {
4
                            sfmap[wr] = RUNA;
4
                    sfmap[wr] = RUNA;
5
                            wr++;
5
                    wr++;
6
                            mtfFreq[RUNA]++;
6
                    mtfFreq[RUNA]++;
7
                        } else {
7
                } else {
8
                            sfmap[wr] = RUNB;
8
                    sfmap[wr] = RUNB;
9
                            wr++;
9
                    wr++;
10
                            mtfFreq[RUNB]++;
10
                    mtfFreq[RUNB]++;
11
                        }
11
                }
12
                        if (zPend >= 2) {
12
                if (zPend >= 2) {
13
                            zPend = (zPend - 2) >> 1;
13
                    zPend = (zPend - 2) >> 1;
14
                        } else {
14
                } else {
15
                            break;
15
                    break;
16
                        }
16
                
17
        
17
}
18
            }
18
            }
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 comparisons91
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    36
    zPend--;
    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