Program: 32828
Project: 32828
Buggy source:
/** 
 * For implementing the ListEventListener interface. When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary. <li>When a list item is updated, it may become visible or become filtered. <li>When a list item is inserted, it may be visible or filtered. <li>When a list item is deleted, it must be filtered if it is not visible.
 */
public final void listChanged(ListEvent listChanges){
  updates.beginEvent();
  if (listChanges.isReordering()) {
    int[] sourceReorderMap=listChanges.getReorderMap();
    int[] filterReorderMap=new int[flagList.getCompressedList().size()];
    SparseList previousFlagList=flagList;
    flagList=new SparseList();
    for (int i=0; i < sourceReorderMap.length; i++) {
      Object flag=previousFlagList.get(sourceReorderMap[i]);
      flagList.add(flag);
      if (flag != null)       filterReorderMap[flagList.getCompressedIndex(i)]=previousFlagList.getCompressedIndex(sourceReorderMap[i]);
    }
    updates.reorder(filterReorderMap);
  }
 else {
    while (listChanges.next()) {
      int sourceIndex=listChanges.getIndex();
      int changeType=listChanges.getType();
      if (changeType == ListEvent.DELETE) {
        boolean wasIncluded=flagList.get(sourceIndex) != null;
        if (wasIncluded) {
          int filteredIndex=flagList.getCompressedIndex(sourceIndex);
          updates.addDelete(filteredIndex);
        }
        flagList.remove(sourceIndex);
      }
 else       if (changeType == ListEvent.INSERT) {
        boolean include=filterMatches(source.get(sourceIndex));
        if (include) {
          flagList.add(sourceIndex,Boolean.TRUE);
          int filteredIndex=flagList.getCompressedIndex(sourceIndex);
          updates.addInsert(filteredIndex);
        }
 else {
          flagList.add(sourceIndex,null);
        }
      }
 else       if (changeType == ListEvent.UPDATE) {
        boolean wasIncluded=flagList.get(sourceIndex) != null;
        boolean include=filterMatches(source.get(sourceIndex));
        if (wasIncluded && !include) {
          int filteredIndex=flagList.getCompressedIndex(sourceIndex);
          flagList.set(sourceIndex,null);
          updates.addDelete(filteredIndex);
        }
 else         if (!wasIncluded && include) {
          flagList.set(sourceIndex,Boolean.TRUE);
          int filteredIndex=flagList.getCompressedIndex(sourceIndex);
          updates.addInsert(filteredIndex);
        }
      }
    }
  }
  updates.commitEvent();
}

Fixed version (ground truth):
/** 
 * For implementing the ListEventListener interface. When the underlying list changes, this notification allows the object to repaint itself or update itself as necessary. <li>When a list item is updated, it may become visible or become filtered. <li>When a list item is inserted, it may be visible or filtered. <li>When a list item is deleted, it must be filtered if it is not visible.
 */
public final void listChanged(ListEvent listChanges){
  updates.beginEvent();
  if (listChanges.isReordering()) {
    int[] sourceReorderMap=listChanges.getReorderMap();
    int[] filterReorderMap=new int[flagList.getCompressedList().size()];
    SparseList previousFlagList=flagList;
    flagList=new SparseList();
    for (int i=0; i < sourceReorderMap.length; i++) {
      Object flag=previousFlagList.get(sourceReorderMap[i]);
      flagList.add(flag);
      if (flag != null)       filterReorderMap[flagList.getCompressedIndex(i)]=previousFlagList.getCompressedIndex(sourceReorderMap[i]);
    }
    updates.reorder(filterReorderMap);
  }
 else {
    while (listChanges.next()) {
      int sourceIndex=listChanges.getIndex();
      int changeType=listChanges.getType();
      if (changeType == ListEvent.DELETE) {
        boolean wasIncluded=flagList.get(sourceIndex) != null;
        if (wasIncluded) {
          int filteredIndex=flagList.getCompressedIndex(sourceIndex);
          updates.addDelete(filteredIndex);
        }
        flagList.remove(sourceIndex);
      }
 else       if (changeType == ListEvent.INSERT) {
        boolean include=filterMatches(source.get(sourceIndex));
        if (include) {
          flagList.add(sourceIndex,Boolean.TRUE);
          int filteredIndex=flagList.getCompressedIndex(sourceIndex);
          updates.addInsert(filteredIndex);
        }
 else {
          flagList.add(sourceIndex,null);
        }
      }
 else       if (changeType == ListEvent.UPDATE) {
        boolean wasIncluded=flagList.get(sourceIndex) != null;
        boolean include=filterMatches(source.get(sourceIndex));
        if (wasIncluded && !include) {
          int filteredIndex=flagList.getCompressedIndex(sourceIndex);
          flagList.set(sourceIndex,null);
          updates.addDelete(filteredIndex);
        }
 else         if (!wasIncluded && include) {
          flagList.set(sourceIndex,Boolean.TRUE);
          int filteredIndex=flagList.getCompressedIndex(sourceIndex);
          updates.addInsert(filteredIndex);
        }
 else         if (wasIncluded && include) {
          int filteredIndex=flagList.getCompressedIndex(sourceIndex);
          updates.addUpdate(filteredIndex);
        }
      }
    }
  }
  updates.commitEvent();
}