Program: 31584
Project: 31584
Buggy source:
@Override public MiningSchema build(BasicML basicML){
  MiningSchema miningSchema=new MiningSchema();
  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 (isActiveColumn(featureSet,columnConfig)) {
        MiningField miningField=new MiningField();
        miningField.setName(FieldName.create(CommonUtils.getSimpleColumnName(columnConfig.getColumnName())));
        miningField.setOptype(getOptype(columnConfig));
        if (columnConfig.isTarget()) {
          miningField.setUsageType(FieldUsageType.TARGET);
        }
 else {
          miningField.setUsageType(FieldUsageType.ACTIVE);
        }
        miningSchema.withMiningFields(miningField);
      }
    }
  }
 else {
    for (    ColumnConfig columnConfig : columnConfigList) {
      if (columnConfig.getColumnNum() >= datasetHeaders.length) {
        break;
      }
      if (columnConfig.isFinalSelect() || columnConfig.isTarget()) {
        MiningField miningField=new MiningField();
        miningField.setName(FieldName.create(CommonUtils.getSimpleColumnName(columnConfig.getColumnName())));
        miningField.setOptype(getOptype(columnConfig));
        if (columnConfig.isTarget()) {
          miningField.setUsageType(FieldUsageType.TARGET);
        }
 else {
          miningField.setUsageType(FieldUsageType.ACTIVE);
        }
        miningSchema.withMiningFields(miningField);
      }
    }
  }
  return miningSchema;
}

Fixed version (ground truth):
@Override public MiningSchema build(BasicML basicML){
  MiningSchema miningSchema=new MiningSchema();
  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 (isActiveColumn(featureSet,columnConfig)) {
        MiningField miningField=new MiningField();
        miningField.setName(FieldName.create(CommonUtils.getSimpleColumnName(columnConfig.getColumnName())));
        miningField.setOptype(getOptype(columnConfig));
        if (columnConfig.isTarget()) {
          miningField.setUsageType(FieldUsageType.TARGET);
        }
 else {
          miningField.setUsageType(FieldUsageType.ACTIVE);
        }
        miningSchema.withMiningFields(miningField);
      }
 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()) {
            MiningField miningField=new MiningField();
            miningField.setName(FieldName.create(CommonUtils.getSimpleColumnName(columnConfig.getColumnName())));
            miningField.setOptype(getOptype(columnConfig));
            if (columnConfig.isTarget()) {
              miningField.setUsageType(FieldUsageType.TARGET);
            }
 else {
              miningField.setUsageType(FieldUsageType.ACTIVE);
            }
            miningSchema.withMiningFields(miningField);
            break;
          }
        }
      }
    }
  }
 else {
    for (    ColumnConfig columnConfig : columnConfigList) {
      if (columnConfig.getColumnNum() >= datasetHeaders.length) {
        break;
      }
      if (columnConfig.isFinalSelect() || columnConfig.isTarget()) {
        MiningField miningField=new MiningField();
        miningField.setName(FieldName.create(CommonUtils.getSimpleColumnName(columnConfig.getColumnName())));
        miningField.setOptype(getOptype(columnConfig));
        if (columnConfig.isTarget()) {
          miningField.setUsageType(FieldUsageType.TARGET);
        }
 else {
          miningField.setUsageType(FieldUsageType.ACTIVE);
        }
        miningSchema.withMiningFields(miningField);
      }
 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()) {
            MiningField miningField=new MiningField();
            miningField.setName(FieldName.create(CommonUtils.getSimpleColumnName(columnConfig.getColumnName())));
            miningField.setOptype(getOptype(columnConfig));
            if (columnConfig.isTarget()) {
              miningField.setUsageType(FieldUsageType.TARGET);
            }
 else {
              miningField.setUsageType(FieldUsageType.ACTIVE);
            }
            miningSchema.withMiningFields(miningField);
            break;
          }
        }
      }
    }
  }
  return miningSchema;
}