Program: 131420
Project: 131420
Buggy source:
public void init(FgExampleList data){
  numTemplates=templates.size();
  if (!prm.includeUnsupportedFeatures) {
    prm.featCountCutoff=Math.max(prm.featCountCutoff,1);
  }
  IntIntDenseVector[][] counts=null;
  if (prm.featCountCutoff >= 1) {
    log.info("String_Node_Str" + prm.featCountCutoff);
    counts=countFeatures(data,templates);
  }
 else   if (templates.isGrowing() && data != null) {
    log.info("String_Node_Str");
    countFeatures(data,templates);
  }
  templates.stopGrowth();
  this.included=new boolean[numTemplates][][];
  for (int t=0; t < numTemplates; t++) {
    FactorTemplate template=templates.get(t);
    int numConfigs=template.getNumConfigs();
    int numFeats=template.getAlphabet().size();
    included[t]=new boolean[numConfigs][numFeats];
  }
  BoolArrays.fill(included,true);
  if (counts != null) {
    excludeByFeatCount(counts);
    counts=null;
  }
  for (int t=0; t < included.length; t++) {
    FactorTemplate template=templates.get(t);
    Alphabet<Feature> alphabet=template.getAlphabet();
    for (int k=0; k < alphabet.size(); k++) {
      if (alphabet.lookupObject(k).isBiasFeature()) {
        for (int c=0; c < included[t].length; c++) {
          included[t][c][k]=true;
        }
      }
    }
  }
  this.indices=new int[numTemplates][][];
  for (int t=0; t < indices.length; t++) {
    FactorTemplate template=templates.get(t);
    int numConfigs=template.getNumConfigs();
    int numFeats=template.getAlphabet().size();
    indices[t]=new int[numConfigs][numFeats];
    for (int c=0; c < indices[t].length; c++) {
      for (int k=0; k < indices[t][c].length; k++) {
        indices[t][c][k]=included[t][c][k] ? numParams++ : -1;
      }
    }
  }
  initialized=true;
}

Fixed version (ground truth):
public void init(FgExampleList data){
  if (templates.isGrowing() && data != null) {
    log.info("String_Node_Str");
    extractAllObsFeats(data,templates);
    templates.stopGrowth();
  }
  numTemplates=templates.size();
  this.included=new boolean[numTemplates][][];
  for (int t=0; t < numTemplates; t++) {
    FactorTemplate template=templates.get(t);
    int numConfigs=template.getNumConfigs();
    int numFeats=template.getAlphabet().size();
    included[t]=new boolean[numConfigs][numFeats];
  }
  BoolArrays.fill(included,true);
  if (!prm.includeUnsupportedFeatures) {
    prm.featCountCutoff=Math.max(prm.featCountCutoff,1);
  }
  if (prm.featCountCutoff >= 1) {
    log.info("String_Node_Str" + prm.featCountCutoff);
    IntIntDenseVector[][] counts=countFeatures(data,templates);
    excludeByFeatCount(counts);
  }
  for (int t=0; t < included.length; t++) {
    FactorTemplate template=templates.get(t);
    Alphabet<Feature> alphabet=template.getAlphabet();
    for (int k=0; k < alphabet.size(); k++) {
      if (alphabet.lookupObject(k).isBiasFeature()) {
        for (int c=0; c < included[t].length; c++) {
          included[t][c][k]=true;
        }
      }
    }
  }
  this.indices=new int[numTemplates][][];
  for (int t=0; t < indices.length; t++) {
    FactorTemplate template=templates.get(t);
    int numConfigs=template.getNumConfigs();
    int numFeats=template.getAlphabet().size();
    indices[t]=new int[numConfigs][numFeats];
    for (int c=0; c < indices[t].length; c++) {
      for (int k=0; k < indices[t][c].length; k++) {
        indices[t][c][k]=included[t][c][k] ? numParams++ : -1;
      }
    }
  }
  initialized=true;
}