Program: 108958
Project: 108958
Buggy source:
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.OUTPUT || event.part == ModelPart.INPUT || event.part == ModelPart.VIEW_CONFIG) {
    if (model != null && model.getOutput() != null) {
      groupsButton.setEnabled(true);
      subsetButton.setEnabled(true);
    }
 else {
      groupsButton.setEnabled(false);
      subsetButton.setEnabled(false);
    }
  }
  if (event.part == ModelPart.SELECTED_ATTRIBUTE) {
    table.setAttribute(model.getSelectedAttribute());
    table.redraw();
  }
 else   if (event.part == reset) {
    reset();
  }
 else   if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
    reset();
  }
 else   if (event.part == target) {
    if (event.data == null) {
      reset();
      return;
    }
    DataDefinition definition=model.getInputConfig().getInput().getDefinition();
    if (target == ModelPart.OUTPUT) {
      definition=model.getOutputConfig().getInput().getDefinition();
    }
    handle=(DataHandle)event.data;
    DataHandle data=handle;
    if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null) {
      data=handle.getView();
    }
    table.setResearchSubset(model.getInputConfig().getResearchSubset());
    table.setGroups(target == ModelPart.OUTPUT ? model.getGroups() : null);
    table.setData(data);
    table.getHeaderImages().clear();
    for (int i=0; i < handle.getNumColumns(); i++) {
      updateHeaderImage(i,definition.getAttributeType(handle.getAttributeName(i)));
    }
    table.setEnabled(true);
    table.redraw();
  }
 else   if (event.part == ModelPart.ATTRIBUTE_TYPE) {
    if ((model != null) && (handle != null)) {
      final String attr=(String)event.data;
      DataDefinition definition=model.getInputConfig().getInput().getDefinition();
      if (target == ModelPart.OUTPUT) {
        definition=model.getOutputConfig().getInput().getDefinition();
      }
      final int index=handle.getColumnIndexOf(attr);
      updateHeaderImage(index,definition.getAttributeType(attr));
      table.setEnabled(true);
      table.redraw();
    }
  }
 else   if (event.part == ModelPart.RESEARCH_SUBSET) {
    table.setResearchSubset((RowSet)event.data);
    table.redraw();
  }
 else   if (event.part == ModelPart.VIEW_CONFIG) {
    DataHandle data=handle;
    if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null) {
      data=handle.getView();
    }
    table.setGroups(target == ModelPart.OUTPUT ? model.getGroups() : null);
    table.setResearchSubset(model.getInputConfig().getResearchSubset());
    if (table.getData() != data)     table.setData(data);
    table.redraw();
    subsetButton.setSelection(model.getViewConfig().isSubset());
  }
}

Fixed version (ground truth):
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.OUTPUT || event.part == ModelPart.INPUT || event.part == ModelPart.VIEW_CONFIG) {
    if (model != null && model.getOutput() != null) {
      groupsButton.setEnabled(true);
      subsetButton.setEnabled(true);
    }
 else {
      groupsButton.setEnabled(false);
      subsetButton.setEnabled(false);
    }
  }
  if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
    reset();
  }
  if (event.part == ModelPart.VIEW_CONFIG) {
    subsetButton.setSelection(model.getViewConfig().isSubset());
  }
}