Program: 131553
Project: 131553
Buggy source:
@Override public FeatureVector calcFeatureVector(int factorId,VarConfig varConfig){
  SrlFactor f=(SrlFactor)sfg.getFactor(factorId);
  SrlFactorTemplate ft=f.getFactorType();
  VarSet vars=varConfig.getVars();
  BinaryStrFVBuilder obsFeats;
  if (ft == SrlFactorTemplate.LINK_ROLE_BINARY || ft == SrlFactorTemplate.LINK_UNARY || ft == SrlFactorTemplate.ROLE_UNARY) {
    Var var=vars.iterator().next();
    int parent;
    int child;
    if (var instanceof LinkVar) {
      parent=((LinkVar)var).getParent();
      child=((LinkVar)var).getChild();
    }
 else {
      parent=((RoleVar)var).getParent();
      child=((RoleVar)var).getChild();
    }
    if (parent == -1) {
      obsFeats=fastGetObsFeats(child);
    }
 else {
      obsFeats=fastGetObsFeats(parent,child);
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + ft);
  }
  FeatureVector fv=new FeatureVector(obsFeats.size());
  String vcStr=ft + "String_Node_Str";
  for (  Var v : varConfig.getVars()) {
    vcStr+=varConfig.getStateName(v);
  }
  if (log.isTraceEnabled()) {
    log.trace("String_Node_Str" + obsFeats.size());
  }
  if (prm.featureHashMod <= 0) {
    int fidx=alphabet.lookupIndexIncrement(new Feature(vcStr + "String_Node_Str",true));
    if (fidx != -1) {
      fv.add(fidx,1.0);
    }
  }
 else {
    int bfidx=alphabet.lookupIndexIncrement(new Feature(vcStr + "String_Node_Str",true));
    String fname=vcStr + "String_Node_Str" + bfidx;
    int hash=fname.hashCode();
    hash=hash % prm.featureHashMod;
    if (hash < 0) {
      hash+=prm.featureHashMod;
    }
    fname=Integer.toString(hash);
    int fidx=alphabet.lookupIndexIncrement(new Feature(fname,true));
    if (fidx != -1) {
      int revHash=reverseHashCode(fname);
      if (revHash < 0) {
        fv.add(fidx,-1.0);
      }
 else {
        fv.add(fidx,1.0);
      }
    }
  }
  if (prm.featureHashMod <= 0) {
    for (    String obsFeat : obsFeats) {
      String fname=vcStr + "String_Node_Str" + obsFeat;
      int fidx=alphabet.lookupIndexIncrement(new Feature(fname));
      if (fidx != -1) {
        fv.add(fidx,1.0);
      }
    }
  }
 else {
    FeatureVectorBuilder fvb=obsFeats.getFvb();
    for (    IntDoubleEntry obsFeat : fvb) {
      String fname=vcStr + "String_Node_Str" + obsFeat.index();
      int hash=fname.hashCode();
      hash=hash % prm.featureHashMod;
      if (hash < 0) {
        hash+=prm.featureHashMod;
      }
      fname=Integer.toString(hash);
      int fidx=alphabet.lookupIndexIncrement(new Feature(fname));
      if (fidx != -1) {
        int revHash=reverseHashCode(fname);
        if (revHash < 0) {
          fv.add(fidx,-1.0);
        }
 else {
          fv.add(fidx,1.0);
        }
      }
    }
  }
  return fv;
}

Fixed version (ground truth):
@Override public FeatureVector calcFeatureVector(int factorId,VarConfig varConfig){
  SrlFactor f=(SrlFactor)sfg.getFactor(factorId);
  SrlFactorTemplate ft=f.getFactorType();
  VarSet vars=varConfig.getVars();
  BinaryStrFVBuilder obsFeats;
  if (ft == SrlFactorTemplate.LINK_ROLE_BINARY || ft == SrlFactorTemplate.LINK_UNARY || ft == SrlFactorTemplate.ROLE_UNARY) {
    Var var=vars.iterator().next();
    int parent;
    int child;
    if (var instanceof LinkVar) {
      parent=((LinkVar)var).getParent();
      child=((LinkVar)var).getChild();
    }
 else {
      parent=((RoleVar)var).getParent();
      child=((RoleVar)var).getChild();
    }
    if (parent == -1) {
      obsFeats=fastGetObsFeats(child);
    }
 else {
      obsFeats=fastGetObsFeats(parent,child);
    }
  }
 else {
    throw new RuntimeException("String_Node_Str" + ft);
  }
  FeatureVector fv=new FeatureVector(obsFeats.size());
  String vcStr=ft + "String_Node_Str";
  for (  Var v : varConfig.getVars()) {
    vcStr+=varConfig.getStateName(v);
  }
  if (log.isTraceEnabled()) {
    log.trace("String_Node_Str" + obsFeats.size());
  }
  if (prm.featureHashMod <= 0) {
    int fidx=alphabet.lookupIndex(new Feature(vcStr + "String_Node_Str",true));
    if (fidx != -1) {
      fv.add(fidx,1.0);
    }
  }
 else {
    int bfidx=alphabet.lookupIndex(new Feature(vcStr + "String_Node_Str",true));
    String fname=vcStr + "String_Node_Str" + bfidx;
    int hash=fname.hashCode();
    hash=hash % prm.featureHashMod;
    if (hash < 0) {
      hash+=prm.featureHashMod;
    }
    fname=Integer.toString(hash);
    int fidx=alphabet.lookupIndex(new Feature(fname,true));
    if (fidx != -1) {
      int revHash=reverseHashCode(fname);
      if (revHash < 0) {
        fv.add(fidx,-1.0);
      }
 else {
        fv.add(fidx,1.0);
      }
    }
  }
  if (prm.featureHashMod <= 0) {
    for (    String obsFeat : obsFeats) {
      String fname=vcStr + "String_Node_Str" + obsFeat;
      int fidx=alphabet.lookupIndex(new Feature(fname));
      if (fidx != -1) {
        fv.add(fidx,1.0);
      }
    }
  }
 else {
    FeatureVectorBuilder fvb=obsFeats.getFvb();
    for (    IntDoubleEntry obsFeat : fvb) {
      String fname=vcStr + "String_Node_Str" + obsFeat.index();
      int hash=fname.hashCode();
      hash=hash % prm.featureHashMod;
      if (hash < 0) {
        hash+=prm.featureHashMod;
      }
      fname=Integer.toString(hash);
      int fidx=alphabet.lookupIndex(new Feature(fname));
      if (fidx != -1) {
        int revHash=reverseHashCode(fname);
        if (revHash < 0) {
          fv.add(fidx,-1.0);
        }
 else {
          fv.add(fidx,1.0);
        }
      }
    }
  }
  return fv;
}