Program: 76706
Project: 76706
Buggy source:
/** 
 * Sets the dataset list to use.
 * @param dataSetList
 */
protected void okPressed(){
  try {
    inputGroup.setName(nameEditor.getText());
    String newToc=UIUtil.convertToModelString(tocEditor.getText(),true);
    if (newToc == null || !newToc.equals(inputGroup.getTocExpression())) {
      inputGroup.setTocExpression(newToc);
    }
    int index=keyChooser.getSelectionIndex();
    if (index == -1) {
      index=keyChooser.indexOf(UIUtil.convertToModelString(keyChooser.getText(),true));
    }
    String oldKeyExpr=inputGroup.getKeyExpr();
    String newKeyExpr=getKeyExpression();
    inputGroup.setKeyExpr(newKeyExpr);
    if (newKeyExpr != null && newKeyExpr.length() != 0 && !newKeyExpr.equals(oldKeyExpr) && index != -1) {
      SlotHandle slotHandle=null;
      if (inputGroup instanceof ListGroupHandle) {
        slotHandle=inputGroup.getHeader();
      }
 else       if (inputGroup instanceof TableGroupHandle) {
        if (inputGroup.getHeader().getCount() != 0) {
          RowHandle rowHandle=((RowHandle)inputGroup.getHeader().get(0));
          CellHandle cellHandle=(CellHandle)rowHandle.getCells().get(0);
          slotHandle=cellHandle.getContent();
        }
      }
      if (slotHandle != null) {
        DataItemHandle dataItemHandle=inputGroup.getElementFactory().newDataItem(null);
        dataItemHandle.setResultSetColumn(((ComputedColumnHandle)columnList.get(index)).getName());
        slotHandle.add(dataItemHandle);
      }
    }
    index=intervalType.getSelectionIndex();
    inputGroup.setInterval(intervalChoices[index].getName());
    if (index != 0) {
      inputGroup.setIntervalRange(intervalRange.getText());
    }
 else {
      inputGroup.setProperty(GroupHandle.INTERVAL_RANGE_PROP,null);
    }
    if (intervalBaseText.getEnabled()) {
      inputGroup.setIntervalBase(UIUtil.convertToModelString(intervalBaseText.getText(),false));
    }
 else {
      inputGroup.setIntervalBase(null);
    }
    inputGroup.setHideDetail(hideDetail.getSelection());
    if (ascending.getSelection()) {
      inputGroup.setSortDirection(DesignChoiceConstants.SORT_DIRECTION_ASC);
    }
 else {
      inputGroup.setSortDirection(DesignChoiceConstants.SORT_DIRECTION_DESC);
    }
    inputGroup.setPageBreakBefore(pagebreakBeforeChoicesAll[pagebreakBeforeCombo.getSelectionIndex()].getName());
    inputGroup.setPageBreakAfter(pagebreakAfterChoicesAll[pagebreakAfterCombo.getSelectionIndex()].getName());
    inputGroup.setPageBreakInside(pagebreakInsideChoicesAll[pagebreakInsideCombo.getSelectionIndex()].getName());
    inputGroup.setRepeatHeader(repeatHeaderButton.getSelection());
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    return;
  }
  setResult(inputGroup);
  super.okPressed();
}

Fixed version (ground truth):
/** 
 * Sets the dataset list to use.
 * @param dataSetList
 */
protected void okPressed(){
  try {
    inputGroup.setName(nameEditor.getText());
    String newToc=UIUtil.convertToModelString(tocEditor.getText(),true);
    if (newToc == null || !newToc.equals(inputGroup.getTocExpression())) {
      inputGroup.setTocExpression(newToc);
    }
    int index=keyChooser.getSelectionIndex();
    if (index == -1 && UIUtil.convertToModelString(keyChooser.getText(),true) != null) {
      String groupKey=UIUtil.convertToModelString(keyChooser.getText(),true);
      if (keyChooser.indexOf(groupKey) != -1) {
        index=keyChooser.indexOf(groupKey);
      }
 else {
        for (int i=0; i < columnList.size(); i++) {
          if (groupKey.equals(DEUtil.getExpression(columnList.get(i)))) {
            index=i;
            break;
          }
        }
      }
    }
    String oldKeyExpr=inputGroup.getKeyExpr();
    String newKeyExpr=getKeyExpression();
    inputGroup.setKeyExpr(newKeyExpr);
    if (newKeyExpr != null && newKeyExpr.length() != 0 && !newKeyExpr.equals(oldKeyExpr) && index != -1) {
      SlotHandle slotHandle=null;
      if (inputGroup instanceof ListGroupHandle) {
        slotHandle=inputGroup.getHeader();
      }
 else       if (inputGroup instanceof TableGroupHandle) {
        if (inputGroup.getHeader().getCount() != 0) {
          RowHandle rowHandle=((RowHandle)inputGroup.getHeader().get(0));
          CellHandle cellHandle=(CellHandle)rowHandle.getCells().get(0);
          slotHandle=cellHandle.getContent();
        }
      }
      if (slotHandle != null) {
        DataItemHandle dataItemHandle=inputGroup.getElementFactory().newDataItem(null);
        dataItemHandle.setResultSetColumn(((ComputedColumnHandle)columnList.get(index)).getName());
        slotHandle.add(dataItemHandle);
      }
    }
    index=intervalType.getSelectionIndex();
    inputGroup.setInterval(intervalChoices[index].getName());
    if (index != 0) {
      inputGroup.setIntervalRange(intervalRange.getText());
    }
 else {
      inputGroup.setProperty(GroupHandle.INTERVAL_RANGE_PROP,null);
    }
    if (intervalBaseText.getEnabled()) {
      inputGroup.setIntervalBase(UIUtil.convertToModelString(intervalBaseText.getText(),false));
    }
 else {
      inputGroup.setIntervalBase(null);
    }
    inputGroup.setHideDetail(hideDetail.getSelection());
    if (ascending.getSelection()) {
      inputGroup.setSortDirection(DesignChoiceConstants.SORT_DIRECTION_ASC);
    }
 else {
      inputGroup.setSortDirection(DesignChoiceConstants.SORT_DIRECTION_DESC);
    }
    inputGroup.setPageBreakBefore(pagebreakBeforeChoicesAll[pagebreakBeforeCombo.getSelectionIndex()].getName());
    inputGroup.setPageBreakAfter(pagebreakAfterChoicesAll[pagebreakAfterCombo.getSelectionIndex()].getName());
    inputGroup.setPageBreakInside(pagebreakInsideChoicesAll[pagebreakInsideCombo.getSelectionIndex()].getName());
    inputGroup.setRepeatHeader(repeatHeaderButton.getSelection());
  }
 catch (  SemanticException e) {
    ExceptionHandler.handle(e);
    return;
  }
  setResult(inputGroup);
  super.okPressed();
}