Program: 131301
Project: 131301
Buggy source:
private LFgExample getExample(AnnoSentence sent,AnnoSentence gold,boolean labeledExample){
  ObsFeatureExtractor obsFe=new SrlFeatureExtractor(prm.fePrm.srlFePrm,sent,cs);
  obsFe=new ObsFeatureCache(obsFe);
  FeatureExtractor fe=new DepParseFeatureExtractor(prm.fePrm.dpFePrm,sent,cs,ofc.getFeAlphabet());
  fe=new FeatureCache(fe);
  JointNlpFactorGraph fg=new JointNlpFactorGraph(prm.fgPrm,sent,cs,obsFe,ofc,fe);
  log.trace("String_Node_Str" + fg.getNumVars() + "String_Node_Str"+ fg.getNumFactors()+ "String_Node_Str"+ fg.getNumEdges());
  VarConfig vc=new VarConfig();
  if (gold != null && gold.getParents() != null) {
    DepParseEncoder.addDepParseTrainAssignment(gold.getParents(),fg.getDpBuilder(),vc);
  }
 else   if (sent.getParents() != null && prm.fgPrm.includeDp && prm.fgPrm.dpPrm.linkVarType == VarType.OBSERVED) {
    DepParseEncoder.addDepParseTrainAssignment(sent.getParents(),fg.getDpBuilder(),vc);
  }
  if (gold != null && gold.getSrlGraph() != null) {
    SrlEncoder.addSrlTrainAssignment(sent,gold.getSrlGraph(),fg.getSrlBuilder(),vc,prm.fgPrm.srlPrm.predictSense,prm.fgPrm.srlPrm.predictPredPos);
  }
  if (gold != null && gold.getRelations() != null) {
    RelationsEncoder.addRelVarAssignments(sent,gold.getRelations(),fg.getRelBuilder(),vc);
  }
  LFgExample ex;
  FactorTemplateList fts=ofc.getTemplates();
  if (labeledExample) {
    ex=new LabeledFgExample(fg,vc,obsFe,fts);
  }
 else {
    ex=new UnlabeledFgExample(fg,vc,obsFe,fts);
  }
  fe.init(ex);
  return ex;
}

Fixed version (ground truth):
private LFgExample getExample(AnnoSentence sent,AnnoSentence gold,boolean labeledExample){
  ObsFeatureExtractor obsFe=new SrlFeatureExtractor(prm.fePrm.srlFePrm,sent,cs);
  obsFe=new ObsFeatureCache(obsFe);
  FeatureExtractor fe=new DepParseFeatureExtractor(prm.fePrm.dpFePrm,sent,cs,ofc.getFeAlphabet());
  fe=new FeatureCache(fe);
  JointNlpFactorGraph fg=new JointNlpFactorGraph(prm.fgPrm,sent,cs,obsFe,ofc,fe);
  log.trace("String_Node_Str" + fg.getNumVars() + "String_Node_Str"+ fg.getNumFactors()+ "String_Node_Str"+ fg.getNumEdges());
  VarConfig vc=new VarConfig();
  if (prm.fgPrm.includeDp) {
    if (gold != null && gold.getParents() != null) {
      DepParseEncoder.addDepParseTrainAssignment(gold.getParents(),fg.getDpBuilder(),vc);
    }
 else     if (sent.getParents() != null && prm.fgPrm.includeDp && prm.fgPrm.dpPrm.linkVarType == VarType.OBSERVED) {
      DepParseEncoder.addDepParseTrainAssignment(sent.getParents(),fg.getDpBuilder(),vc);
    }
  }
  if (prm.fgPrm.includeSrl) {
    if (gold != null && gold.getSrlGraph() != null) {
      SrlEncoder.addSrlTrainAssignment(sent,gold.getSrlGraph(),fg.getSrlBuilder(),vc,prm.fgPrm.srlPrm.predictSense,prm.fgPrm.srlPrm.predictPredPos);
    }
  }
  if (prm.fgPrm.includeRel) {
    if (gold != null && gold.getRelations() != null) {
      RelationsEncoder.addRelVarAssignments(sent,gold.getRelations(),fg.getRelBuilder(),vc);
    }
  }
  LFgExample ex;
  FactorTemplateList fts=ofc.getTemplates();
  if (labeledExample) {
    ex=new LabeledFgExample(fg,vc,obsFe,fts);
  }
 else {
    ex=new UnlabeledFgExample(fg,vc,obsFe,fts);
  }
  fe.init(ex);
  return ex;
}