Program: 131209
Project: 131209
Buggy source:
public static FgAndVars getLinearChainFgWithVars(){
  FactorGraph fg=new FactorGraph();
  Var w0=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var w1=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var w2=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var t0=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var t1=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var t2=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  ExplicitFactor emit0=new ExplicitFactor(new VarSet(t0,w0));
  ExplicitFactor emit1=new ExplicitFactor(new VarSet(t1,w1));
  ExplicitFactor emit2=new ExplicitFactor(new VarSet(t2,w2));
  emit0.setValue(0,0.1);
  emit0.setValue(1,0.9);
  emit1.setValue(0,0.3);
  emit1.setValue(1,0.7);
  emit2.setValue(0,0.5);
  emit2.setValue(1,0.5);
  ExplicitFactor tran0=new ExplicitFactor(new VarSet(t0,t1));
  ExplicitFactor tran1=new ExplicitFactor(new VarSet(t1,t2));
  tran0.fill(1);
  tran0.setValue(0,0.2);
  tran0.setValue(1,0.3);
  tran0.setValue(2,0.4);
  tran0.setValue(3,0.5);
  tran1.fill(1);
  tran1.setValue(0,1.2);
  tran1.setValue(1,1.3);
  tran1.setValue(2,1.4);
  tran1.setValue(3,1.5);
  fg.addFactor(emit0);
  fg.addFactor(emit1);
  fg.addFactor(emit2);
  fg.addFactor(tran0);
  fg.addFactor(tran1);
  for (  Factor f : fg.getFactors()) {
    ((ExplicitFactor)f).convertRealToLog();
  }
  FgAndVars fgv=new FgAndVars();
  fgv.fg=fg;
  fgv.w0=w0;
  fgv.w1=w1;
  fgv.w2=w2;
  fgv.t0=t0;
  fgv.t1=t1;
  fgv.t2=t2;
  fgv.emit0=emit0;
  fgv.emit1=emit1;
  fgv.emit2=emit2;
  fgv.tran0=tran0;
  fgv.tran1=tran1;
  return fgv;
}

Fixed version (ground truth):
public static FgAndVars getLinearChainFgWithVars(){
  FactorGraph fg=new FactorGraph();
  Var w0=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var w1=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var w2=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var t0=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var t1=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  Var t2=new Var(VarType.PREDICTED,2,"String_Node_Str",Lists.getList("String_Node_Str","String_Node_Str"));
  ExplicitFactor emit0=new ExplicitFactor(new VarSet(t0,w0));
  ExplicitFactor emit1=new ExplicitFactor(new VarSet(t1,w1));
  ExplicitFactor emit2=new ExplicitFactor(new VarSet(t2,w2));
  emit0.setValue(0,0.1);
  emit0.setValue(1,0.9);
  emit1.setValue(0,0.3);
  emit1.setValue(1,0.7);
  emit2.setValue(0,0.5);
  emit2.setValue(1,0.5);
  ExplicitFactor tran0=new ExplicitFactor(new VarSet(t0,t1));
  ExplicitFactor tran1=new ExplicitFactor(new VarSet(t1,t2));
  tran0.fill(1);
  tran0.setValue(0,0.2);
  tran0.setValue(1,0.4);
  tran0.setValue(2,0.3);
  tran0.setValue(3,0.5);
  tran1.fill(1);
  tran1.setValue(0,1.2);
  tran1.setValue(1,1.4);
  tran1.setValue(2,1.3);
  tran1.setValue(3,1.5);
  fg.addFactor(emit0);
  fg.addFactor(emit1);
  fg.addFactor(emit2);
  fg.addFactor(tran0);
  fg.addFactor(tran1);
  for (  Factor f : fg.getFactors()) {
    ((ExplicitFactor)f).convertRealToLog();
  }
  FgAndVars fgv=new FgAndVars();
  fgv.fg=fg;
  fgv.w0=w0;
  fgv.w1=w1;
  fgv.w2=w2;
  fgv.t0=t0;
  fgv.t1=t1;
  fgv.t2=t2;
  fgv.emit0=emit0;
  fgv.emit1=emit1;
  fgv.emit2=emit2;
  fgv.tran0=tran0;
  fgv.tran1=tran1;
  return fgv;
}