Program: 31583
Project: 31583
Buggy source:
@Override public DataDictionary build(BasicML basicML){
  DataDictionary dict=new DataDictionary();
  List<DataField> fields=new ArrayList<DataField>();
  if (basicML != null && basicML instanceof BasicFloatNetwork) {
    BasicFloatNetwork bfn=(BasicFloatNetwork)basicML;
    Set<Integer> featureSet=bfn.getFeatureSet();
    for (    ColumnConfig columnConfig : columnConfigList) {
      if (columnConfig.getColumnNum() >= datasetHeaders.length) {
        break;
      }
      if (isConcise) {
        if (columnConfig.isFinalSelect() && (CollectionUtils.isEmpty(featureSet) || featureSet.contains(columnConfig.getColumnNum())) || columnConfig.isTarget()) {
          fields.add(convertColumnToDataField(columnConfig));
        }
      }
 else {
        fields.add(convertColumnToDataField(columnConfig));
      }
    }
  }
 else {
    for (    ColumnConfig columnConfig : columnConfigList) {
      if (columnConfig.getColumnNum() >= datasetHeaders.length) {
        break;
      }
      if (isConcise) {
        if (columnConfig.isFinalSelect() || columnConfig.isTarget()) {
          fields.add(convertColumnToDataField(columnConfig));
        }
      }
 else {
        fields.add(convertColumnToDataField(columnConfig));
      }
    }
  }
  dict.withDataFields(fields);
  dict.withNumberOfFields(fields.size());
  return dict;
}

Fixed version (ground truth):
@Override public DataDictionary build(BasicML basicML){
  DataDictionary dict=new DataDictionary();
  List<DataField> fields=new ArrayList<DataField>();
  boolean isSegExpansionMode=columnConfigList.size() > datasetHeaders.length;
  int segSize=segmentExpansions.size();
  if (basicML != null && basicML instanceof BasicFloatNetwork) {
    BasicFloatNetwork bfn=(BasicFloatNetwork)basicML;
    Set<Integer> featureSet=bfn.getFeatureSet();
    for (    ColumnConfig columnConfig : columnConfigList) {
      if (columnConfig.getColumnNum() >= datasetHeaders.length) {
        break;
      }
      if (isConcise) {
        if (columnConfig.isFinalSelect() && (CollectionUtils.isEmpty(featureSet) || featureSet.contains(columnConfig.getColumnNum())) || columnConfig.isTarget()) {
          fields.add(convertColumnToDataField(columnConfig));
        }
 else         if (isSegExpansionMode) {
          for (int i=0; i < segSize; i++) {
            int newIndex=datasetHeaders.length * (i + 1) + columnConfig.getColumnNum();
            ColumnConfig cc=columnConfigList.get(newIndex);
            if (cc.isFinalSelect()) {
              fields.add(convertColumnToDataField(columnConfig));
              break;
            }
          }
        }
      }
 else {
        fields.add(convertColumnToDataField(columnConfig));
      }
    }
  }
 else {
    for (    ColumnConfig columnConfig : columnConfigList) {
      if (columnConfig.getColumnNum() >= datasetHeaders.length) {
        break;
      }
      if (isConcise) {
        if (columnConfig.isFinalSelect() || columnConfig.isTarget()) {
          fields.add(convertColumnToDataField(columnConfig));
        }
 else         if (isSegExpansionMode) {
          for (int i=0; i < segSize; i++) {
            int newIndex=datasetHeaders.length * (i + 1) + columnConfig.getColumnNum();
            ColumnConfig cc=columnConfigList.get(newIndex);
            if (cc.isFinalSelect()) {
              fields.add(convertColumnToDataField(columnConfig));
              break;
            }
          }
        }
      }
 else {
        fields.add(convertColumnToDataField(columnConfig));
      }
    }
  }
  dict.withDataFields(fields);
  dict.withNumberOfFields(fields.size());
  return dict;
}