Program: 75502
Project: 75502
Buggy source:
/** 
 * Encounter a conditionalSend that is already waiting on this conditionalReceive. Since this conditionalReceive arrived second, check if both branches are "first" and if so perform the data transfer and reset the state of the receiver. Since a conditionalSend can "disappear," then this method can return to the top of the main loop in the run method that calls this method. Return true if this method should go to the top of the calling loop; return false otherwise.
 * @return true if this method should continue at the beginning ofthe loop that calls this method; otherwise return false.
 * @param controller The conditional branch controller that control thisconditional receive.
 * @param receiver The CSPReceiver through which a rendezvous attempt istaking place.
 */
protected boolean _arriveAfterConditionalSend(CSPReceiver receiver,ConditionalBranchController controller) throws InterruptedException {
  if (controller._isBranchFirst(getID())) {
    if (receiver._getOtherController()._isBranchFirst(getID())) {
      setToken(receiver.get());
      receiver._setConditionalSend(false,null);
      controller._branchSucceeded(getID());
      return false;
    }
 else {
      controller._releaseFirst(getID());
      receiver.notifyAll();
    }
  }
  getController()._branchBlocked(this.getReceiver());
  getReceiver()._checkFlagsAndWait();
  getController()._branchUnblocked(this.getReceiver());
  return true;
}

Fixed version (ground truth):
/** 
 * Encounter a conditionalSend that is already waiting on this conditionalReceive. Since this conditionalReceive arrived second, check if both branches are "first" and if so perform the data transfer and reset the state of the receiver. Since a conditionalSend can "disappear," then this method can return to the top of the main loop in the run method that calls this method. Return true if this method should go to the top of the calling loop; return false otherwise.
 * @return true if this method should continue at the beginning ofthe loop that calls this method; otherwise return false.
 * @param controller The conditional branch controller that control thisconditional receive.
 * @param receiver The CSPReceiver through which a rendezvous attempt istaking place.
 */
protected boolean _arriveAfterConditionalSend(CSPReceiver receiver,ConditionalBranchController controller) throws InterruptedException {
  System.out.println(Thread.currentThread().getName() + "String_Node_Str" + "String_Node_Str"+ controller._isBranchFirst(getID())+ "String_Node_Str"+ "String_Node_Str"+ receiver._isPutWaiting()+ "String_Node_Str"+ receiver._getOtherController()._isBranchFirst(receiver.getOtherID()));
  if (controller._isBranchFirst(getID())) {
    if (receiver._getOtherController()._isBranchFirst(receiver.getOtherID())) {
      setToken(receiver.get());
      receiver._setConditionalSend(false,null,-1);
      controller._branchSucceeded(getID());
      return false;
    }
 else {
      controller._releaseFirst(getID());
      receiver.notifyAll();
    }
  }
  getController()._branchBlocked(this.getReceiver());
  getReceiver()._checkFlagsAndWait();
  getController()._branchUnblocked(this.getReceiver());
  return true;
}