Program: 131250
Project: 131250
Buggy source:
public List<List<FeatTemplate>> selectFeatureTemplates(List<FeatTemplate> allTpls,List<ValExtractor> valExts,AnnoSentenceCollection sents,CorpusStatisticsPrm csPrm,int numToSelect){
  if (allTpls.size() <= numToSelect) {
    List<List<FeatTemplate>> selected=new ArrayList<List<FeatTemplate>>();
    for (int c=0; c < valExts.size(); c++) {
      selected.add(allTpls);
    }
    return selected;
  }
  if (prm.maxNumSentences < sents.size()) {
    log.info("String_Node_Str" + prm.maxNumSentences + "String_Node_Str");
    sents=sents.subList(0,prm.maxNumSentences);
  }
  CorpusStatistics cs=new CorpusStatistics(csPrm);
  cs.init(sents);
  for (int c=0; c < valExts.size(); c++) {
    ValExtractor valExt=valExts.get(c);
    valExt.init(sents,prm.valueHashMod);
    log.info(String.format("String_Node_Str",c,valExt.getName(),valExt.getNumVals()));
  }
  log.info("String_Node_Str");
  Pair<double[][],int[]> pair=computeInformationGain(allTpls,valExts,sents,cs);
  double[][] ig=pair.get1();
  int[] featCount=pair.get2();
  try {
    Writer writer=null;
    if (prm.outFile != null) {
      log.info("String_Node_Str" + prm.outFile);
      writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(prm.outFile,true),"String_Node_Str"));
    }
    List<List<FeatTemplate>> selected=new ArrayList<List<FeatTemplate>>();
    for (int c=0; c < valExts.size(); c++) {
      selected.add(filterFeatTemplates(allTpls,valExts.get(c),ig[c],featCount,writer,numToSelect));
    }
    if (writer != null) {
      writer.close();
    }
    return selected;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public List<List<FeatTemplate>> selectFeatureTemplates(List<FeatTemplate> allTpls,List<ValExtractor> valExts,AnnoSentenceCollection inputSents,AnnoSentenceCollection goldSents,CorpusStatisticsPrm csPrm,int numToSelect){
  if (allTpls.size() <= numToSelect) {
    List<List<FeatTemplate>> selected=new ArrayList<List<FeatTemplate>>();
    for (int c=0; c < valExts.size(); c++) {
      selected.add(allTpls);
    }
    return selected;
  }
  if (prm.maxNumSentences < goldSents.size()) {
    log.info("String_Node_Str" + prm.maxNumSentences + "String_Node_Str");
    inputSents=inputSents.subList(0,prm.maxNumSentences);
    goldSents=goldSents.subList(0,prm.maxNumSentences);
  }
  CorpusStatistics cs=new CorpusStatistics(csPrm);
  cs.init(inputSents);
  for (int c=0; c < valExts.size(); c++) {
    ValExtractor valExt=valExts.get(c);
    valExt.init(goldSents,prm.valueHashMod);
    log.info(String.format("String_Node_Str",c,valExt.getName(),valExt.getNumVals()));
  }
  log.info("String_Node_Str");
  Pair<double[][],int[]> pair=computeInformationGain(allTpls,valExts,inputSents,goldSents,cs);
  double[][] ig=pair.get1();
  int[] featCount=pair.get2();
  try {
    Writer writer=null;
    if (prm.outFile != null) {
      log.info("String_Node_Str" + prm.outFile);
      writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(prm.outFile,true),"String_Node_Str"));
    }
    List<List<FeatTemplate>> selected=new ArrayList<List<FeatTemplate>>();
    for (int c=0; c < valExts.size(); c++) {
      selected.add(filterFeatTemplates(allTpls,valExts.get(c),ig[c],featCount,writer,numToSelect));
    }
    if (writer != null) {
      writer.close();
    }
    return selected;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}