CloneSet2


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
135220.951statement_sequence[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1139222
E:/TSE/Projects-CloneDR/apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java
2135377
E:/TSE/Projects-CloneDR/apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java
Next
Last
Clone Instance
1
Line Count
139
Source Line
222
Source File
E:/TSE/Projects-CloneDR/apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java

for (int i = alphaSize; --i >= 0;) {
  weight[i + 1] = (freq[i] == 0 ? 1: freq[i]) << 8;
}
for (boolean tooLong = true; tooLong;) {
  tooLong = false;
  int nNodes = alphaSize;
  int nHeap = 0;
  heap[0] = 0;
  weight[0] = 0;
  parent[0] = -2;
  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;
  }
  // assert (nHeap < (MAX_ALPHA_SIZE + 2)) : nHeap;
  while (nHeap > 1) {
    int n1 = heap[1];
    heap[1] = heap[nHeap];
    nHeap--;
    int yy = 0;
    int zz = 1;
    int tmp = heap[1];
    while (true) {
      yy = zz << 1;
      if (yy > nHeap) {
        break;
      }
      if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) {
        yy++;
      }
      if (weight[tmp] < weight[heap[yy]]) {
        break;
      }
      heap[zz] = heap[yy];
      zz = yy;
    }
    heap[zz] = tmp;
    int n2 = heap[1];
    heap[1] = heap[nHeap];
    nHeap--;
    yy = 0;
    zz = 1;
    tmp = heap[1];
    while (true) {
      yy = zz << 1;
      if (yy > nHeap) {
        break;
      }
      if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) {
        yy++;
      }
      if (weight[tmp] < weight[heap[yy]]) {
        break;
      }
      heap[zz] = heap[yy];
      zz = yy;
    }
    heap[zz] = tmp;
    nNodes++;
    parent[n1] = parent[n2] = nNodes;
    final int weight_n1 = weight[n1];
    final int weight_n2 = weight[n2];
    weight[nNodes] = (((weight_n1&0xffffff00) + (weight_n2&0xffffff00))|(1 + (((weight_n1&0x000000ff) > (weight_n2&0x000000ff)) ? (weight_n1&0x000000ff): (weight_n2&0x000000ff))));
    parent[nNodes] = -1;
    nHeap++;
    heap[nHeap] = nNodes;
    tmp = 0;
    zz = nHeap;
    tmp = heap[zz];
    final int weight_tmp = weight[tmp];
    while (weight_tmp < weight[heap[zz >> 1]]) {
      heap[zz] = heap[zz >> 1];
      zz >>= 1;
    }
    heap[zz] = tmp;
  }
  // assert (nNodes < (MAX_ALPHA_SIZE * 2)) : nNodes;
  for (int i = 1; i <= alphaSize; i++) {
    int j = 0;
    int k = i;
    for (int parent_k; (parent_k = parent[k]) >= 0;) {
      k = parent_k;
      j++;
    }
    len[i - 1] = (char) j;
    if (j > maxLen) {
      tooLong = true;
    }
  }
  if (tooLong) {
    for (int i = 1; i < alphaSize; i++) {
      int j = weight[i] >> 8;
      j = 1 + (j >> 1);
      weight[i] = j << 8;
    }
  }
}


First
Previous
Clone Instance
2
Line Count
135
Source Line
377
Source File
E:/TSE/Projects-CloneDR/apache-ant-1.7.0/src/org/apache/tools/bzip2/CBZip2OutputStream.java

for (int i = alphaSize; --i >= 0;) {
  weight[i + 1] = (freq[i] == 0 ? 1: freq[i]) << 8;
}
for (boolean tooLong = true; tooLong;) {
  tooLong = false;
  int nNodes = alphaSize;
  int nHeap = 0;
  heap[0] = 0;
  weight[0] = 0;
  parent[0] = -2;
  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;
  }
  while (nHeap > 1) {
    int n1 = heap[1];
    heap[1] = heap[nHeap];
    nHeap--;
    int yy = 0;
    int zz = 1;
    int tmp = heap[1];
    while (true) {
      yy = zz << 1;
      if (yy > nHeap) {
        break;
      }
      if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) {
        yy++;
      }
      if (weight[tmp] < weight[heap[yy]]) {
        break;
      }
      heap[zz] = heap[yy];
      zz = yy;
    }
    heap[zz] = tmp;
    int n2 = heap[1];
    heap[1] = heap[nHeap];
    nHeap--;
    yy = 0;
    zz = 1;
    tmp = heap[1];
    while (true) {
      yy = zz << 1;
      if (yy > nHeap) {
        break;
      }
      if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) {
        yy++;
      }
      if (weight[tmp] < weight[heap[yy]]) {
        break;
      }
      heap[zz] = heap[yy];
      zz = yy;
    }
    heap[zz] = tmp;
    nNodes++;
    parent[n1] = parent[n2] = nNodes;
    final int weight_n1 = weight[n1];
    final int weight_n2 = weight[n2];
    weight[nNodes] = ((weight_n1&0xffffff00) + (weight_n2&0xffffff00))|(1 + (((weight_n1&0x000000ff) > (weight_n2&0x000000ff)) ? (weight_n1&0x000000ff): (weight_n2&0x000000ff)));
    parent[nNodes] = -1;
    nHeap++;
    heap[nHeap] = nNodes;
    tmp = 0;
    zz = nHeap;
    tmp = heap[zz];
    final int weight_tmp = weight[tmp];
    while (weight_tmp < weight[heap[zz >> 1]]) {
      heap[zz] = heap[zz >> 1];
      zz >>= 1;
    }
    heap[zz] = tmp;
  }
  for (int i = 1; i <= alphaSize; i++) {
    int j = 0;
    int k = i;
    for (int parent_k; (parent_k = parent[k]) >= 0;) {
      k = parent_k;
      j++;
    }
    len[i - 1] = (byte) j;
    if (j > maxLen) {
      tooLong = true;
    }
  }
  if (tooLong) {
    for (int i = 1; i < alphaSize; i++) {
      int j = weight[i] >> 8;
      j = 1 + (j >> 1);
      weight[i] = j << 8;
    }
  }
}


Clone AbstractionParameter Count: 2Parameter Bindings

for (int i = alphaSize; --i >= 0;) {
  weight[i + 1] = (freq[i] == 0 ? 1: freq[i]) << 8;
}
for (boolean tooLong = true; tooLong;) {
  tooLong = false;
  int nNodes = alphaSize;
  int nHeap = 0;
  heap[0] = 0;
  weight[0] = 0;
  parent[0] = -2;
  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;
  }
  // assert (nHeap < (MAX_ALPHA_SIZE + 2)) : nHeap;
  while (nHeap > 1) {
    int n1 = heap[1];
    heap[1] = heap[nHeap];
    nHeap--;
    int yy = 0;
    int zz = 1;
    int tmp = heap[1];
    while (true) {
      yy = zz << 1;
      if (yy > nHeap) {
        break;
      }
      if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) {
        yy++;
      }
      if (weight[tmp] < weight[heap[yy]]) {
        break;
      }
      heap[zz] = heap[yy];
      zz = yy;
    }
    heap[zz] = tmp;
    int n2 = heap[1];
    heap[1] = heap[nHeap];
    nHeap--;
    yy = 0;
    zz = 1;
    tmp = heap[1];
    while (true) {
      yy = zz << 1;
      if (yy > nHeap) {
        break;
      }
      if ((yy < nHeap) && (weight[heap[yy + 1]] < weight[heap[yy]])) {
        yy++;
      }
      if (weight[tmp] < weight[heap[yy]]) {
        break;
      }
      heap[zz] = heap[yy];
      zz = yy;
    }
    heap[zz] = tmp;
    nNodes++;
    parent[n1] = parent[n2] = nNodes;
    final int weight_n1 = weight[n1];
    final int weight_n2 = weight[n2];
    weight[nNodes] = [[#variablefd23720]];
    parent[nNodes] = -1;
    nHeap++;
    heap[nHeap] = nNodes;
    tmp = 0;
    zz = nHeap;
    tmp = heap[zz];
    final int weight_tmp = weight[tmp];
    while (weight_tmp < weight[heap[zz >> 1]]) {
      heap[zz] = heap[zz >> 1];
      zz >>= 1;
    }
    heap[zz] = tmp;
  }
  // assert (nNodes < (MAX_ALPHA_SIZE * 2)) : nNodes;
  for (int i = 1; i <= alphaSize; i++) {
    int j = 0;
    int k = i;
    for (int parent_k; (parent_k = parent[k]) >= 0;) {
      k = parent_k;
      j++;
    }
    len[i - 1] = ( [[#variablefd23060]]) j;
    if (j > maxLen) {
      tooLong = true;
    }
  }
  if (tooLong) {
    for (int i = 1; i < alphaSize; i++) {
      int j = weight[i] >> 8;
      j = 1 + (j >> 1);
      weight[i] = j << 8;
    }
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#fd23720]]
(((weight_n1&0xffffff00) + (weight_n2&0xffffff00))|(1 + (((weight_n1&0x000000ff) > (weight_n2&0x000000ff)) ? (weight_n1&0x000000ff): (weight_n2&0x000000ff)))) 
12[[#fd23720]]
((weight_n1&0xffffff00) + (weight_n2&0xffffff00))|(1 + (((weight_n1&0x000000ff) > (weight_n2&0x000000ff)) ? (weight_n1&0x000000ff): (weight_n2&0x000000ff))) 
21[[#fd23060]]
char 
22[[#fd23060]]
byte