Program: 90273
Project: 90273
Buggy source:
/** 
 * In-place bitwise XOR (symmetric difference) operation. The current bitmap is modified.
 * @param x2 other bitmap
 */
public void xor(final ImmutableRoaringBitmap x2){
  int pos1=0, pos2=0;
  int length1=highLowContainer.size();
  final int length2=x2.highLowContainer.size();
  main:   if (pos1 < length1 && pos2 < length2) {
    short s1=highLowContainer.getKeyAtIndex(pos1);
    short s2=x2.highLowContainer.getKeyAtIndex(pos2);
    while (true) {
      if (s1 == s2) {
        final MappeableContainer c=highLowContainer.getContainerAtIndex(pos1).ixor(x2.highLowContainer.getContainerAtIndex(pos2));
        if (c.getCardinality() > 0) {
          this.getMappeableRoaringArray().setContainerAtIndex(pos1,c);
          pos1++;
        }
 else {
          getMappeableRoaringArray().removeAtIndex(pos1);
          --length1;
        }
        pos2++;
        if ((pos1 == length1) || (pos2 == length2)) {
          break main;
        }
        s1=highLowContainer.getKeyAtIndex(pos1);
        s2=x2.highLowContainer.getKeyAtIndex(pos2);
      }
 else       if (Util.compareUnsigned(s1,s2) < 0) {
        pos1++;
        if (pos1 == length1) {
          break main;
        }
        s1=highLowContainer.getKeyAtIndex(pos1);
      }
 else {
        getMappeableRoaringArray().insertNewKeyValueAt(pos1,(short)s2,x2.highLowContainer.getContainerAtIndex(pos2));
        pos1++;
        length1++;
        pos2++;
        if (pos2 == length2) {
          break main;
        }
        s2=x2.highLowContainer.getKeyAtIndex(pos2);
      }
    }
  }
  if (pos1 == length1) {
    getMappeableRoaringArray().appendCopy(x2.highLowContainer,pos2,length2);
  }
}

Fixed version (ground truth):
/** 
 * In-place bitwise XOR (symmetric difference) operation. The current bitmap is modified.
 * @param x2 other bitmap
 */
public void xor(final ImmutableRoaringBitmap x2){
  int pos1=0, pos2=0;
  int length1=highLowContainer.size();
  final int length2=x2.highLowContainer.size();
  main:   if (pos1 < length1 && pos2 < length2) {
    short s1=highLowContainer.getKeyAtIndex(pos1);
    short s2=x2.highLowContainer.getKeyAtIndex(pos2);
    while (true) {
      if (s1 == s2) {
        final MappeableContainer c=highLowContainer.getContainerAtIndex(pos1).ixor(x2.highLowContainer.getContainerAtIndex(pos2));
        if (c.getCardinality() > 0) {
          this.getMappeableRoaringArray().setContainerAtIndex(pos1,c);
          pos1++;
        }
 else {
          getMappeableRoaringArray().removeAtIndex(pos1);
          --length1;
        }
        pos2++;
        if ((pos1 == length1) || (pos2 == length2)) {
          break main;
        }
        s1=highLowContainer.getKeyAtIndex(pos1);
        s2=x2.highLowContainer.getKeyAtIndex(pos2);
      }
 else       if (Util.compareUnsigned(s1,s2) < 0) {
        pos1++;
        if (pos1 == length1) {
          break main;
        }
        s1=highLowContainer.getKeyAtIndex(pos1);
      }
 else {
        getMappeableRoaringArray().insertNewKeyValueAt(pos1,(short)s2,x2.highLowContainer.getContainerAtIndex(pos2).clone());
        pos1++;
        length1++;
        pos2++;
        if (pos2 == length2) {
          break main;
        }
        s2=x2.highLowContainer.getKeyAtIndex(pos2);
      }
    }
  }
  if (pos1 == length1) {
    getMappeableRoaringArray().appendCopy(x2.highLowContainer,pos2,length2);
  }
}