Program: 131502
Project: 131502
Buggy source:
private FgExamples getData(FeatureTemplateList fts,CorpusStatistics cs,DatasetType dataType,File dataFile,File goldFile,int maxNumSentences,int maxSentenceLength,String name) throws ParseException, IOException {
  log.info("String_Node_Str" + name + "String_Node_Str"+ dataType+ "String_Node_Str"+ dataFile);
  FgExamples data;
  SimpleAnnoSentenceCollection sents;
  int numTokens=0;
  if (dataType == DatasetType.CONLL_2009) {
    List<CoNLL09Sentence> conllSents=new ArrayList<CoNLL09Sentence>();
    sents=new SimpleAnnoSentenceCollection();
    CoNLL09FileReader reader=new CoNLL09FileReader(dataFile);
    for (    CoNLL09Sentence sent : reader) {
      if (sents.size() >= maxNumSentences) {
        break;
      }
      if (sent.size() <= maxSentenceLength) {
        sent.intern();
        sent=mungeData(sent);
        conllSents.add(sent);
        sents.add(sent.toSimpleAnnoSentence(cs.prm.useGoldSyntax));
        numTokens+=sent.size();
      }
    }
    reader.close();
    if (goldFile != null) {
      log.info("String_Node_Str" + goldFile);
      CoNLL09Writer cw=new CoNLL09Writer(goldFile);
      for (      CoNLL09Sentence sent : conllSents) {
        cw.write(sent);
      }
      cw.close();
    }
  }
 else {
    throw new ParseException("String_Node_Str" + dataType);
  }
  log.info("String_Node_Str" + name + "String_Node_Str"+ sents.size());
  log.info("String_Node_Str" + name + "String_Node_Str"+ numTokens);
  if (!cs.isInitialized()) {
    log.info("String_Node_Str");
    cs.init(sents);
  }
  log.info("String_Node_Str");
  SrlFgExampleBuilderPrm prm=getSrlFgExampleBuilderPrm();
  SrlFgExamplesBuilder builder=new SrlFgExamplesBuilder(prm,fts,cs);
  data=builder.getData(sents);
  if (prm.fgPrm.predictSense) {
    Var v=new Var(VarType.PREDICTED,1,CorpusStatistics.UNKNOWN_SENSE,CorpusStatistics.SENSES_FOR_UNK_PRED);
    fts.add(new FeatureTemplate(new VarSet(v),new Alphabet<Feature>(),CorpusStatistics.UNKNOWN_SENSE));
  }
  log.info(String.format("String_Node_Str",name,data.size()));
  log.info(String.format("String_Node_Str",name,data.getNumFactors()));
  log.info(String.format("String_Node_Str",name,data.getNumVars()));
  log.info(String.format("String_Node_Str",data.getTemplates().size()));
  log.info(String.format("String_Node_Str",data.getTemplates().getNumObsFeats()));
  return data;
}

Fixed version (ground truth):
private FgExamples getData(FeatureTemplateList fts,CorpusStatistics cs,DatasetType dataType,File dataFile,File goldFile,int maxNumSentences,int maxSentenceLength,String name) throws ParseException, IOException {
  log.info("String_Node_Str" + name + "String_Node_Str"+ dataType+ "String_Node_Str"+ dataFile);
  FgExamples data;
  SimpleAnnoSentenceCollection sents;
  int numTokens=0;
  if (dataType == DatasetType.CONLL_2009) {
    List<CoNLL09Sentence> conllSents=new ArrayList<CoNLL09Sentence>();
    sents=new SimpleAnnoSentenceCollection();
    CoNLL09FileReader reader=new CoNLL09FileReader(dataFile);
    for (    CoNLL09Sentence sent : reader) {
      if (sents.size() >= maxNumSentences) {
        break;
      }
      if (sent.size() <= maxSentenceLength) {
        sent.intern();
        sent=mungeData(sent);
        conllSents.add(sent);
        sents.add(sent.toSimpleAnnoSentence(cs.prm.useGoldSyntax));
        numTokens+=sent.size();
      }
    }
    reader.close();
    if (goldFile != null) {
      log.info("String_Node_Str" + goldFile);
      CoNLL09Writer cw=new CoNLL09Writer(goldFile);
      for (      CoNLL09Sentence sent : conllSents) {
        cw.write(sent);
      }
      cw.close();
    }
  }
 else {
    throw new ParseException("String_Node_Str" + dataType);
  }
  log.info("String_Node_Str" + name + "String_Node_Str"+ sents.size());
  log.info("String_Node_Str" + name + "String_Node_Str"+ numTokens);
  if (!cs.isInitialized()) {
    log.info("String_Node_Str");
    cs.init(sents);
  }
  log.info("String_Node_Str");
  SrlFgExampleBuilderPrm prm=getSrlFgExampleBuilderPrm();
  SrlFgExamplesBuilder builder=new SrlFgExamplesBuilder(prm,fts,cs);
  data=builder.getData(sents);
  if (prm.fgPrm.predictSense) {
    Var v=new Var(VarType.PREDICTED,1,CorpusStatistics.UNKNOWN_SENSE,CorpusStatistics.SENSES_FOR_UNK_PRED);
    fts.add(new FeatureTemplate(new VarSet(v),new Alphabet<Feature>(),SrlFactorGraph.TEMPLATE_KEY_FOR_UNKNOWN_SENSE));
  }
  log.info(String.format("String_Node_Str",name,data.size()));
  log.info(String.format("String_Node_Str",name,data.getNumFactors()));
  log.info(String.format("String_Node_Str",name,data.getNumVars()));
  log.info(String.format("String_Node_Str",data.getTemplates().size()));
  log.info(String.format("String_Node_Str",data.getTemplates().getNumObsFeats()));
  return data;
}