for (int i = 1; i <= alphaSize; i++) { parent[i] = -1; nHeap++; heap[nHeap] = i; int zz = nHeap; int tmp = heap[zz]; while (weight[tmp] < weight[heap[zz >> 1]]) { heap[zz] = heap[zz >> 1]; zz >>= 1; } heap[zz] = tmp; }
for (int i = 1; i <= alphaSize; i++) { parent[i] = -1; nHeap++; heap[nHeap] = i; int zz = nHeap; int tmp = heap[zz]; while (weight[tmp] < weight[heap[zz >> 1]]) { heap[zz] = heap[zz >> 1]; zz >>= 1; } heap[zz] = tmp; }
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 hbMakeCodeLengths(char[], int[], int, int) Method name: void hbMakeCodeLengths(byte[], int[], Data, int, int)
Number of AST nodes: 10 Number of AST nodes: 10
1
for (int i = 1; i <= alphaSize; i++) {
1
for (int i = 1; i <= alphaSize; i++) {
2
                parent[i] = -1;
2
                parent[i] = -1;
3
                nHeap++;
3
                nHeap++;
4
                heap[nHeap] = i;
4
                heap[nHeap] = i;
5
                int zz = nHeap;
5
                int zz = nHeap;
6
                int tmp = heap[zz];
6
                int tmp = heap[zz];
7
                while (weight[tmp] < weight[heap[zz >> 1]]) {
7
                while (weight[tmp] < weight[heap[zz >> 1]]) {
8
                    heap[zz] = heap[zz >> 1];
8
                    heap[zz] = heap[zz >> 1];
9
                    zz >>= 1;
9
                    zz >>= 1;
10
                }
10
                }
11
                heap[zz] = tmp;
11
                heap[zz] = tmp;
12
            }
12
            }
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 declared in the same class
Number of node comparisons67
  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)2.7
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    13
    for (int i = 1; i <= alphaSize; i++)
    13
    for (int i = 1; i <= alphaSize; i++)
    14
    parent[i] = -1;
    14
    parent[i] = -1;
    15
    nHeap++;
    15
    nHeap++;
    16
    heap[nHeap] = i;
    16
    heap[nHeap] = i;
    17
    int zz = nHeap;
    17
    int zz = nHeap;
    18
    int tmp = heap[zz];
    18
    int tmp = heap[zz];
    19
    while (weight[tmp] < weight[heap[zz >> 1]])
    19
    while (weight[tmp] < weight[heap[zz >> 1]])
    20
    heap[zz] = heap[zz >> 1];
    20
    heap[zz] = heap[zz >> 1];
    21
    zz >>= 1;
    21
    zz >>= 1;
    22
    heap[zz] = tmp;
    22
    heap[zz] = tmp;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables nHeap, heap, parent , while Clone fragment #2 returns variables nHeap, heap, parent