Program: 79292
Project: 79292
Buggy source:
void adaptBaseDataSet(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  dteDataSet.setDataSource(modelDataSet.getDataSourceName());
  dteDataSet.setBeforeOpenScript(modelDataSet.getBeforeOpen());
  dteDataSet.setAfterOpenScript(modelDataSet.getAfterOpen());
  dteDataSet.setOnFetchScript(modelDataSet.getOnFetch());
  dteDataSet.setBeforeCloseScript(modelDataSet.getBeforeClose());
  dteDataSet.setAfterCloseScript(modelDataSet.getAfterClose());
  Iterator elmtIter=modelDataSet.parametersIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      DataSetParameterHandle modelParam=(DataSetParameterHandle)elmtIter.next();
      dteDataSet.addParameter(newParam(modelParam));
    }
  }
  elmtIter=modelDataSet.paramBindingsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ParamBindingHandle modelParamBinding=(ParamBindingHandle)elmtIter.next();
      dteDataSet.addInputParamBinding(newInputParamBinding(modelParamBinding));
    }
  }
  elmtIter=modelDataSet.computedColumnsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ComputedColumnHandle modelCmptdColumn=(ComputedColumnHandle)elmtIter.next();
      IComputedColumn dteCmptdColumn=newComputedColumn(modelCmptdColumn);
      dteDataSet.addComputedColumn(dteCmptdColumn);
    }
  }
  elmtIter=modelDataSet.filtersIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      FilterConditionHandle modelFilter=(FilterConditionHandle)elmtIter.next();
      IFilterDefinition dteFilter=newFilter(modelFilter);
      dteDataSet.addFilter(dteFilter);
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      dteDataSet.addResultSetHint(newColumnDefn(modelColumnHint));
    }
  }
  List columnDefns=dteDataSet.getResultSetHints();
  elmtIter=modelDataSet.resultSetIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumn.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumn);
 else       dteDataSet.addResultSetHint(newColumnDefn(modelColumn));
    }
  }
}

Fixed version (ground truth):
void adaptBaseDataSet(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  dteDataSet.setDataSource(modelDataSet.getDataSourceName());
  dteDataSet.setBeforeOpenScript(modelDataSet.getBeforeOpen());
  dteDataSet.setAfterOpenScript(modelDataSet.getAfterOpen());
  dteDataSet.setOnFetchScript(modelDataSet.getOnFetch());
  dteDataSet.setBeforeCloseScript(modelDataSet.getBeforeClose());
  dteDataSet.setAfterCloseScript(modelDataSet.getAfterClose());
  Iterator elmtIter=modelDataSet.parametersIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      DataSetParameterHandle modelParam=(DataSetParameterHandle)elmtIter.next();
      dteDataSet.addParameter(newParam(modelParam));
      if (modelParam.isInput()) {
        dteDataSet.addInputParamBinding(newInputParamBinding(modelParam.getName(),modelParam.getDefaultValue()));
      }
    }
  }
  elmtIter=modelDataSet.paramBindingsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ParamBindingHandle modelParamBinding=(ParamBindingHandle)elmtIter.next();
      dteDataSet.addInputParamBinding(newInputParamBinding(modelParamBinding));
    }
  }
  elmtIter=modelDataSet.computedColumnsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ComputedColumnHandle modelCmptdColumn=(ComputedColumnHandle)elmtIter.next();
      IComputedColumn dteCmptdColumn=newComputedColumn(modelCmptdColumn);
      dteDataSet.addComputedColumn(dteCmptdColumn);
    }
  }
  elmtIter=modelDataSet.filtersIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      FilterConditionHandle modelFilter=(FilterConditionHandle)elmtIter.next();
      IFilterDefinition dteFilter=newFilter(modelFilter);
      dteDataSet.addFilter(dteFilter);
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      dteDataSet.addResultSetHint(newColumnDefn(modelColumnHint));
    }
  }
  List columnDefns=dteDataSet.getResultSetHints();
  elmtIter=modelDataSet.resultSetIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumn.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumn);
 else       dteDataSet.addResultSetHint(newColumnDefn(modelColumn));
    }
  }
}