Program: 90276
Project: 90276
Buggy source:
private MappeableContainer operationArrayGuess(MappeableRunContainer x,int opcode){
  ShortBuffer ansArray=ShortBuffer.allocate(10);
  int card=0;
  int thisHead, xHead;
  ShortIterator it=getShortIterator();
  ShortIterator xIt=x.getShortIterator();
  thisHead=(it.hasNext() ? BufferUtil.toIntUnsigned(it.next()) : -1);
  xHead=(xIt.hasNext() ? BufferUtil.toIntUnsigned(xIt.next()) : -1);
  while (thisHead != -1 && xHead != -1) {
    if (thisHead > xHead) {
      if (opcode == OP_OR || opcode == OP_XOR) {
        if (card == ansArray.capacity())         ansArray=increaseCapacity(ansArray);
        ansArray.put(card++,(short)xHead);
      }
      xHead=(xIt.hasNext() ? BufferUtil.toIntUnsigned(xIt.next()) : -1);
    }
 else     if (thisHead < xHead) {
      if (opcode != OP_AND) {
        if (card == ansArray.capacity())         ansArray=increaseCapacity(ansArray);
        ansArray.put(card++,(short)thisHead);
      }
      thisHead=(it.hasNext() ? BufferUtil.toIntUnsigned(it.next()) : -1);
    }
 else {
      if (opcode == OP_AND || opcode == OP_OR) {
        if (card == ansArray.capacity())         ansArray=increaseCapacity(ansArray);
        ansArray.put(card++,(short)thisHead);
      }
      thisHead=(it.hasNext() ? BufferUtil.toIntUnsigned(it.next()) : -1);
      xHead=(xIt.hasNext() ? BufferUtil.toIntUnsigned(xIt.next()) : -1);
    }
  }
  if (opcode != OP_AND) {
    while (thisHead != -1) {
      if (card == ansArray.capacity())       ansArray=increaseCapacity(ansArray);
      ansArray.put(card++,(short)thisHead);
      thisHead=(it.hasNext() ? BufferUtil.toIntUnsigned(it.next()) : -1);
    }
    if (opcode == OP_OR || opcode == OP_XOR)     while (xHead != -1) {
      if (card == ansArray.capacity())       ansArray=increaseCapacity(ansArray);
      ansArray.put(card++,(short)xHead);
      xHead=(xIt.hasNext() ? BufferUtil.toIntUnsigned(xIt.next()) : -1);
    }
  }
  ShortBuffer content=ShortBuffer.allocate(card);
  ansArray.flip();
  content.put(ansArray);
  MappeableArrayContainer ac=new MappeableArrayContainer(content,card);
  if (card > MappeableArrayContainer.DEFAULT_MAX_SIZE)   return ac.toBitmapContainer();
 else   return ac;
}

Fixed version (ground truth):
private MappeableContainer operationArrayGuess(MappeableRunContainer x,int opcode){
  ShortBuffer ansArray=ShortBuffer.allocate(10);
  int card=0;
  int thisHead, xHead;
  ShortIterator it=getShortIterator();
  ShortIterator xIt=x.getShortIterator();
  thisHead=(it.hasNext() ? BufferUtil.toIntUnsigned(it.next()) : -1);
  xHead=(xIt.hasNext() ? BufferUtil.toIntUnsigned(xIt.next()) : -1);
  while (thisHead != -1 && xHead != -1) {
    if (thisHead > xHead) {
      if (opcode == OP_OR || opcode == OP_XOR) {
        if (card == ansArray.capacity())         ansArray=increaseCapacity(ansArray);
        ansArray.put((short)xHead);
        card++;
      }
      xHead=(xIt.hasNext() ? BufferUtil.toIntUnsigned(xIt.next()) : -1);
    }
 else     if (thisHead < xHead) {
      if (opcode != OP_AND) {
        if (card == ansArray.capacity())         ansArray=increaseCapacity(ansArray);
        ansArray.put((short)thisHead);
        card++;
      }
      thisHead=(it.hasNext() ? BufferUtil.toIntUnsigned(it.next()) : -1);
    }
 else {
      if (opcode == OP_AND || opcode == OP_OR) {
        if (card == ansArray.capacity())         ansArray=increaseCapacity(ansArray);
        ansArray.put((short)thisHead);
        card++;
      }
      thisHead=(it.hasNext() ? BufferUtil.toIntUnsigned(it.next()) : -1);
      xHead=(xIt.hasNext() ? BufferUtil.toIntUnsigned(xIt.next()) : -1);
    }
  }
  if (opcode != OP_AND) {
    while (thisHead != -1) {
      if (card == ansArray.capacity())       ansArray=increaseCapacity(ansArray);
      ansArray.put((short)thisHead);
      card++;
      thisHead=(it.hasNext() ? BufferUtil.toIntUnsigned(it.next()) : -1);
    }
    if (opcode == OP_OR || opcode == OP_XOR)     while (xHead != -1) {
      if (card == ansArray.capacity())       ansArray=increaseCapacity(ansArray);
      ansArray.put((short)xHead);
      card++;
      xHead=(xIt.hasNext() ? BufferUtil.toIntUnsigned(xIt.next()) : -1);
    }
  }
  ShortBuffer content=ShortBuffer.allocate(card);
  ansArray.flip();
  content.put(ansArray);
  MappeableArrayContainer ac=new MappeableArrayContainer(content,card);
  if (card > MappeableArrayContainer.DEFAULT_MAX_SIZE)   return ac.toBitmapContainer();
 else   return ac;
}