Program: 88556
Project: 88556
Buggy source:
/** 
 * Condition Expression Creation - can maybe merge with If
 */
private soot.Local getConditionalLocal(polyglot.ast.Conditional condExpr){
  polyglot.ast.Expr condition=condExpr.cond();
  soot.Value sootCond=base().createExpr(condition);
  boolean needIf=needSootIf(sootCond);
  if (!(sootCond instanceof soot.jimple.ConditionExpr)) {
    sootCond=soot.jimple.Jimple.v().newEqExpr(sootCond,soot.jimple.IntConstant.v(0));
  }
 else {
    sootCond=reverseCondition((soot.jimple.ConditionExpr)sootCond);
    sootCond=handleDFLCond((soot.jimple.ConditionExpr)sootCond);
  }
  soot.jimple.Stmt noop1=soot.jimple.Jimple.v().newNopStmt();
  if (needIf) {
    soot.jimple.IfStmt ifStmt=soot.jimple.Jimple.v().newIfStmt(sootCond,noop1);
    body.getUnits().add(ifStmt);
    Util.addLnPosTags(ifStmt,condExpr.position());
    Util.addLnPosTags(ifStmt.getConditionBox(),condition.position());
  }
  soot.Local retLocal=generateLocal(condExpr.type());
  polyglot.ast.Expr consequence=condExpr.consequent();
  soot.Value conseqVal=base().createExpr(consequence);
  soot.jimple.AssignStmt conseqAssignStmt=soot.jimple.Jimple.v().newAssignStmt(retLocal,conseqVal);
  body.getUnits().add(conseqAssignStmt);
  Util.addLnPosTags(conseqAssignStmt,condExpr.position());
  Util.addLnPosTags(conseqAssignStmt.getRightOpBox(),consequence.position());
  soot.jimple.Stmt noop2=soot.jimple.Jimple.v().newNopStmt();
  soot.jimple.Stmt goto1=soot.jimple.Jimple.v().newGotoStmt(noop2);
  body.getUnits().add(goto1);
  body.getUnits().add(noop1);
  polyglot.ast.Expr alternative=condExpr.alternative();
  if (alternative != null) {
    soot.Value altVal=base().createExpr(alternative);
    soot.jimple.AssignStmt altAssignStmt=soot.jimple.Jimple.v().newAssignStmt(retLocal,altVal);
    body.getUnits().add(altAssignStmt);
    Util.addLnPosTags(altAssignStmt,condExpr.position());
    Util.addLnPosTags(altAssignStmt,alternative.position());
    Util.addLnPosTags(altAssignStmt.getRightOpBox(),alternative.position());
  }
  body.getUnits().add(noop2);
  return retLocal;
}

Fixed version (ground truth):
/** 
 * Condition Expression Creation - can maybe merge with If
 */
private soot.Local getConditionalLocal(polyglot.ast.Conditional condExpr){
  polyglot.ast.Expr condition=condExpr.cond();
  soot.Value sootCond=base().createExpr(condition);
  boolean needIf=needSootIf(sootCond);
  if (!(sootCond instanceof soot.jimple.ConditionExpr)) {
    sootCond=soot.jimple.Jimple.v().newEqExpr(sootCond,soot.jimple.IntConstant.v(0));
  }
 else {
    sootCond=reverseCondition((soot.jimple.ConditionExpr)sootCond);
    sootCond=handleDFLCond((soot.jimple.ConditionExpr)sootCond);
  }
  soot.jimple.Stmt noop1=soot.jimple.Jimple.v().newNopStmt();
  if (needIf) {
    soot.jimple.IfStmt ifStmt=soot.jimple.Jimple.v().newIfStmt(sootCond,noop1);
    body.getUnits().add(ifStmt);
    Util.addLnPosTags(ifStmt,condExpr.position());
    Util.addLnPosTags(ifStmt.getConditionBox(),condition.position());
  }
  soot.Local retLocal=generateLocal(condExpr.type());
  polyglot.ast.Expr consequence=condExpr.consequent();
  soot.Value conseqVal=base().createExpr(consequence);
  if (conseqVal instanceof soot.jimple.ConditionExpr) {
    conseqVal=handleCondBinExpr((soot.jimple.ConditionExpr)conseqVal);
  }
  soot.jimple.AssignStmt conseqAssignStmt=soot.jimple.Jimple.v().newAssignStmt(retLocal,conseqVal);
  body.getUnits().add(conseqAssignStmt);
  Util.addLnPosTags(conseqAssignStmt,condExpr.position());
  Util.addLnPosTags(conseqAssignStmt.getRightOpBox(),consequence.position());
  soot.jimple.Stmt noop2=soot.jimple.Jimple.v().newNopStmt();
  soot.jimple.Stmt goto1=soot.jimple.Jimple.v().newGotoStmt(noop2);
  body.getUnits().add(goto1);
  body.getUnits().add(noop1);
  polyglot.ast.Expr alternative=condExpr.alternative();
  if (alternative != null) {
    soot.Value altVal=base().createExpr(alternative);
    if (altVal instanceof soot.jimple.ConditionExpr) {
      altVal=handleCondBinExpr((soot.jimple.ConditionExpr)altVal);
    }
    soot.jimple.AssignStmt altAssignStmt=soot.jimple.Jimple.v().newAssignStmt(retLocal,altVal);
    body.getUnits().add(altAssignStmt);
    Util.addLnPosTags(altAssignStmt,condExpr.position());
    Util.addLnPosTags(altAssignStmt,alternative.position());
    Util.addLnPosTags(altAssignStmt.getRightOpBox(),alternative.position());
  }
  body.getUnits().add(noop2);
  return retLocal;
}