Program: 100512
Project: 100512
Buggy source:
/** 
 * Add all members of set to this.
 * @param set
 * @return true iff the value of this changes.
 */
public boolean addAll(IntSet set){
  boolean change=false;
  if (set instanceof SemiSparseMutableIntSet) {
    SemiSparseMutableIntSet that=(SemiSparseMutableIntSet)set;
    if (densePart == null) {
      if (that.densePart != null) {
        densePart=new OffsetBitVector(that.densePart);
        for (int b=densePart.nextSetBit(0); b != -1; b=densePart.nextSetBit(b + 1)) {
          if (sparsePart.contains(b)) {
            sparsePart.remove(b);
          }
 else {
            change=true;
          }
        }
        for (IntIterator bits=that.sparsePart.intIterator(); bits.hasNext(); ) {
          change|=sparsePart.add(bits.next());
        }
      }
 else {
        for (IntIterator bs=that.sparsePart.intIterator(); bs.hasNext(); ) {
          change|=add(bs.next());
        }
      }
    }
 else {
      int oldSize=size();
      if (that.densePart != null) {
        densePart.or(that.densePart);
        for (IntIterator bs=that.sparsePart.intIterator(); bs.hasNext(); ) {
          add(bs.next());
        }
        for (IntIterator bs=sparsePart.intIterator(); bs.hasNext(); ) {
          int b=bs.next();
          if (densePart.get(b)) {
            sparsePart.remove(b);
          }
        }
        change=(size() != oldSize);
      }
 else {
        for (IntIterator bs=that.sparsePart.intIterator(); bs.hasNext(); ) {
          change|=add(bs.next());
        }
      }
    }
  }
 else {
    for (IntIterator bs=set.intIterator(); bs.hasNext(); ) {
      change|=add(bs.next());
    }
  }
  return change;
}

Fixed version (ground truth):
/** 
 * Add all members of set to this.
 * @param set
 * @return true iff the value of this changes.
 */
public boolean addAll(IntSet set){
  boolean change=false;
  if (set instanceof SemiSparseMutableIntSet) {
    SemiSparseMutableIntSet that=(SemiSparseMutableIntSet)set;
    if (densePart == null) {
      if (that.densePart != null) {
        int oldSize=size();
        densePart=new OffsetBitVector(that.densePart);
        for (IntIterator bits=sparsePart.intIterator(); bits.hasNext(); ) {
          int bit=bits.next();
          if (inDenseRange(bit)) {
            densePart.set(bit);
          }
        }
        sparsePart.removeAll(densePart);
        sparsePart.addAll(that.sparsePart);
        change=size() != oldSize;
      }
 else {
        change=sparsePart.addAll(that.sparsePart);
        fixAfterSparseInsert();
      }
    }
 else {
      if (that.densePart != null) {
        int oldSize=size();
        densePart.or(that.densePart);
        sparsePart.addAll(that.sparsePart);
        for (IntIterator bits=sparsePart.intIterator(); bits.hasNext(); ) {
          int bit=bits.next();
          if (inDenseRange(bit)) {
            densePart.set(bit);
          }
        }
        sparsePart.removeAll(densePart);
        change=size() != oldSize;
      }
 else {
        for (IntIterator bs=that.sparsePart.intIterator(); bs.hasNext(); ) {
          change|=add(bs.next());
        }
      }
    }
  }
 else {
    for (IntIterator bs=set.intIterator(); bs.hasNext(); ) {
      change|=add(bs.next());
    }
  }
  assertDisjoint();
  return change;
}