Program: 108708
Project: 108708
Buggy source:
/** 
 * Updates the view config
 * @param force Force update even if unchanged
 */
private void updateViewConfig(boolean force){
  if (!force && !model.isViewConfigChanged())   return;
  ModelViewConfig config=model.getViewConfig();
  DataHandle handle=(config.getMode() == Mode.SORTED_INPUT) ? model.getInputConfig().getInput().getHandle() : model.getOutput();
  handle=config.isSubset() ? handle.getView() : handle;
  DataDefinition definition=handle.getDefinition();
  if (config.getMode() == Mode.SORTED_INPUT || config.getMode() == Mode.SORTED_OUTPUT) {
    Swapper swapper=new Swapper(){
      @Override public void swap(      int arg0,      int arg1){
        model.getInputConfig().getResearchSubset().swap(arg0,arg1);
      }
    }
;
    handle.sort(swapper,true,handle.getColumnIndexOf(config.getAttribute()));
    model.setGroups(null);
  }
 else {
    int[] indices=new int[definition.getQuasiIdentifyingAttributes().size()];
    int index=0;
    for (    String attribute : definition.getQuasiIdentifyingAttributes()) {
      indices[index++]=handle.getColumnIndexOf(attribute);
    }
    Swapper swapper=new Swapper(){
      @Override public void swap(      int arg0,      int arg1){
        model.getInputConfig().getResearchSubset().swap(arg0,arg1);
      }
    }
;
    handle.sort(swapper,true,indices);
    int[] groups=new int[handle.getNumRows()];
    int groupIdx=0;
    groups[0]=0;
    for (int row=1; row < handle.getNumRows(); row++) {
      boolean newClass=false;
      for (      int column : indices) {
        if (!handle.getValue(row,column).equals(handle.getValue(row - 1,column))) {
          newClass=true;
          break;
        }
      }
      groupIdx+=newClass ? 1 : 0;
      groups[row]=groupIdx;
    }
    model.setGroups(groups);
  }
}

Fixed version (ground truth):
/** 
 * Updates the view config
 * @param force Force update even if unchanged
 */
private void updateViewConfig(boolean force){
  ModelViewConfig config=model.getViewConfig();
  if (!force && !config.isChanged())   return;
  DataHandle handle=(config.getMode() == Mode.SORTED_INPUT) ? model.getInputConfig().getInput().getHandle() : model.getOutput();
  handle=config.isSubset() ? handle.getView() : handle;
  DataDefinition definition=handle.getDefinition();
  if (config.getMode() == Mode.SORTED_INPUT || config.getMode() == Mode.SORTED_OUTPUT) {
    Swapper swapper=new Swapper(){
      @Override public void swap(      int arg0,      int arg1){
        model.getInputConfig().getResearchSubset().swap(arg0,arg1);
      }
    }
;
    handle.sort(swapper,config.getSortOrder(),handle.getColumnIndexOf(config.getAttribute()));
    model.setGroups(null);
  }
 else {
    int[] indices=new int[definition.getQuasiIdentifyingAttributes().size()];
    int index=0;
    for (    String attribute : definition.getQuasiIdentifyingAttributes()) {
      indices[index++]=handle.getColumnIndexOf(attribute);
    }
    Swapper swapper=new Swapper(){
      @Override public void swap(      int arg0,      int arg1){
        model.getInputConfig().getResearchSubset().swap(arg0,arg1);
      }
    }
;
    handle.sort(swapper,true,indices);
    int[] groups=new int[handle.getNumRows()];
    int groupIdx=0;
    groups[0]=0;
    for (int row=1; row < handle.getNumRows(); row++) {
      boolean newClass=false;
      for (      int column : indices) {
        if (!handle.getValue(row,column).equals(handle.getValue(row - 1,column))) {
          newClass=true;
          break;
        }
      }
      groupIdx+=newClass ? 1 : 0;
      groups[row]=groupIdx;
    }
    model.setGroups(groups);
  }
}