Program: 132647
Project: 132647
Buggy source:
/** 
 * Merge in information about writes to this variable that can occur in nested contexts
 * @param file
 * @param line
 * @param branches
 * @param exhaustive
 * @return
 */
private ArrayList<Violation> mergeBranchWriteInfo(Context context,List<VInfo> branches,boolean exhaustive){
  ArrayList<Violation> result=new ArrayList<Violation>();
  Ternary assignedInBranch;
  Ternary appendedInBranch;
  int expectAssignedDepth;
  if (exhaustive) {
    VInfo firstBranch=branches.get(0);
    assignedInBranch=firstBranch.assigned;
    appendedInBranch=firstBranch.appended;
    expectAssignedDepth=firstBranch.arrayAssignDepth;
  }
 else {
    assignedInBranch=Ternary.FALSE;
    appendedInBranch=Ternary.FALSE;
    expectAssignedDepth=0;
  }
  for (int i=0; i < branches.size(); i++) {
    VInfo currBr=branches.get(i);
    if (assignedInBranch == Ternary.FALSE) {
      expectAssignedDepth=currBr.arrayAssignDepth;
    }
    if (assignedInBranch != Ternary.FALSE && currBr.assigned != Ternary.FALSE) {
      if (currBr.arrayAssignDepth != expectAssignedDepth) {
        result.add(new Violation(ViolationType.ERROR,"String_Node_Str" + name + "String_Node_Str"+ "String_Node_Str",context));
      }
    }
    assignedInBranch=Ternary.consensus(assignedInBranch,currBr.assigned);
    appendedInBranch=Ternary.consensus(appendedInBranch,currBr.appended);
  }
  this.appended=Ternary.or(appended,appendedInBranch);
  if (assignedInBranch == Ternary.FALSE) {
    return result;
  }
 else   if (this.assigned == Ternary.FALSE) {
    this.assigned=assignedInBranch;
    this.arrayAssignDepth=expectAssignedDepth;
    return result;
  }
 else   if (Types.isArray(this.type)) {
    this.assigned=Ternary.or(assigned,assignedInBranch);
    if (this.arrayAssignDepth != expectAssignedDepth) {
      result.add(makeArrDepthViolation(context,expectAssignedDepth));
    }
    return result;
  }
 else {
    if (Ternary.and(assignedInBranch,this.assigned) == Ternary.TRUE) {
      result.add(new Violation(ViolationType.ERROR,"String_Node_Str" + name + "String_Node_Str",context));
      return result;
    }
    if (assignedInBranch == Ternary.MAYBE) {
      result.add(new Violation(ViolationType.WARNING,"String_Node_Str" + name + "String_Node_Str",context));
    }
    if ((this.assigned != Ternary.FALSE && assignedInBranch == Ternary.MAYBE) || (assignedInBranch != Ternary.FALSE && this.assigned == Ternary.MAYBE)) {
      result.add(new Violation(ViolationType.WARNING,"String_Node_Str" + name + "String_Node_Str",context));
    }
    this.assigned=Ternary.or(this.assigned,assignedInBranch);
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Merge in information about writes to this variable that can occur in nested contexts
 * @param file
 * @param line
 * @param branches
 * @param exhaustive
 * @return
 */
private ArrayList<Violation> mergeBranchWriteInfo(Context context,List<VInfo> branches,boolean exhaustive){
  ArrayList<Violation> result=new ArrayList<Violation>();
  Ternary assignedInBranch;
  Ternary appendedInBranch;
  if (exhaustive) {
    VInfo firstBranch=branches.get(0);
    assignedInBranch=firstBranch.assigned;
    appendedInBranch=firstBranch.appended;
  }
 else {
    assignedInBranch=Ternary.FALSE;
    appendedInBranch=Ternary.FALSE;
  }
  for (int i=0; i < branches.size(); i++) {
    VInfo currBr=branches.get(i);
    assignedInBranch=Ternary.consensus(assignedInBranch,currBr.assigned);
    appendedInBranch=Ternary.consensus(appendedInBranch,currBr.appended);
  }
  this.appended=Ternary.or(appended,appendedInBranch);
  if (assignedInBranch == Ternary.FALSE) {
    return result;
  }
 else   if (this.assigned == Ternary.FALSE) {
    this.assigned=assignedInBranch;
    return result;
  }
 else   if (Types.isArray(this.type)) {
    this.assigned=Ternary.or(assigned,assignedInBranch);
    return result;
  }
 else {
    if (Ternary.and(assignedInBranch,this.assigned) == Ternary.TRUE) {
      result.add(new Violation(ViolationType.ERROR,"String_Node_Str" + name + "String_Node_Str",context));
      return result;
    }
    if (assignedInBranch == Ternary.MAYBE) {
      result.add(new Violation(ViolationType.WARNING,"String_Node_Str" + name + "String_Node_Str",context));
    }
    if ((this.assigned != Ternary.FALSE && assignedInBranch == Ternary.MAYBE) || (assignedInBranch != Ternary.FALSE && this.assigned == Ternary.MAYBE)) {
      result.add(new Violation(ViolationType.WARNING,"String_Node_Str" + name + "String_Node_Str",context));
    }
    this.assigned=Ternary.or(this.assigned,assignedInBranch);
    return result;
  }
}