Program: 74974
Project: 74974
Buggy source:
/** 
 * Get the receivers that are ready to form a rendezvous according to the rendezvous semantics. If no rendezvous can be formed starting for the given array of receivers, null is returned.
 * @param receivers The array of receivers to be put to or get from.
 * @param isPut If true, the rendezvous is to put tokens to thereceivers; if false, the rendezvous is to get tokens from the receivers.
 * @param readyReceivers The set of receivers that are already ready for arendezvous, or null if no receivers are already ready.
 * @return A set of receivers that participate in the rendezvous ifit can be formed, or null if no rendezvous can be formed.
 * @see #_commitRendezvous(Set,RendezvousDirector)
 */
private static Set _receiversReadyToCommitRecursive(Receiver[][] receivers,boolean isPut,Set readyReceivers){
  Set checkedReceivers=new HashSet();
  boolean isConditional=false;
  for (int i=0; i < receivers.length; i++) {
    if (receivers[i] != null) {
      for (int j=0; j < receivers[i].length; j++) {
        if (receivers[i][j] != null) {
          RendezvousReceiver castReceiver=(RendezvousReceiver)receivers[i][j];
          isConditional=(isPut && castReceiver._putConditional) || (!isPut && castReceiver._getConditional);
          if (castReceiver._isVisited || (readyReceivers != null && readyReceivers.contains(castReceiver))) {
            checkedReceivers.add(castReceiver);
          }
 else {
            if ((castReceiver._putWaiting == null) || (castReceiver._getWaiting == null)) {
              checkedReceivers.clear();
              break;
            }
 else {
              Receiver[][] farSideReceivers=isPut ? castReceiver._getReceivers : castReceiver._putReceivers;
              castReceiver._isVisited=true;
              Set nestedReadyReceivers=_receiversReadyToCommitRecursive(farSideReceivers,!isPut,readyReceivers);
              castReceiver._isVisited=false;
              if (nestedReadyReceivers == null) {
                checkedReceivers.clear();
                break;
              }
 else {
                checkedReceivers.add(castReceiver);
                checkedReceivers.addAll(nestedReadyReceivers);
              }
            }
          }
        }
      }
      if ((isConditional && (checkedReceivers.size() > 0)) || (!isConditional && (checkedReceivers.size() == 0))) {
        break;
      }
    }
  }
  return (checkedReceivers.size() > 0) ? checkedReceivers : null;
}

Fixed version (ground truth):
/** 
 * Get the receivers that are ready to form a rendezvous according to the rendezvous semantics. If no rendezvous can be formed starting for the given array of receivers, null is returned.
 * @param receivers The array of receivers to be put to or get from.
 * @param isPut If true, the rendezvous is to put tokens to thereceivers; if false, the rendezvous is to get tokens from the receivers.
 * @param readyReceivers The set of receivers that are already ready for arendezvous, or null if no receivers are already ready.
 * @return A set of receivers that participate in the rendezvous ifit can be formed, or null if no rendezvous can be formed.
 * @see #_commitRendezvous(Set,RendezvousDirector)
 */
private static Set _receiversReadyToCommitRecursive(Receiver[][] receivers,boolean isPut,Set readyReceivers){
  Set checkedReceivers=new HashSet();
  boolean isConditional=false;
  for (int i=0; i < receivers.length; i++) {
    if (receivers[i] != null) {
      for (int j=0; j < receivers[i].length; j++) {
        if (receivers[i][j] != null) {
          RendezvousReceiver castReceiver=(RendezvousReceiver)receivers[i][j];
          isConditional=(isPut && castReceiver._putConditional) || (!isPut && castReceiver._getConditional);
          if (castReceiver._isVisited || (readyReceivers != null && readyReceivers.contains(castReceiver))) {
            checkedReceivers.add(castReceiver);
          }
 else {
            if ((castReceiver._putWaiting == null) || (castReceiver._getWaiting == null)) {
              checkedReceivers.clear();
              break;
            }
 else {
              Receiver[][] farSideReceivers=isPut ? castReceiver._getReceivers : castReceiver._putReceivers;
              castReceiver._isVisited=true;
              Set nestedReadyReceivers=_receiversReadyToCommitRecursive(farSideReceivers,!isPut,readyReceivers);
              castReceiver._isVisited=false;
              if (nestedReadyReceivers == null) {
                checkedReceivers.clear();
                break;
              }
 else {
                Set newReadyReceivers=new HashSet();
                if (readyReceivers != null) {
                  newReadyReceivers.addAll(readyReceivers);
                }
                newReadyReceivers.addAll(checkedReceivers);
                newReadyReceivers.add(castReceiver);
                newReadyReceivers.addAll(nestedReadyReceivers);
                Iterator receiverIterator=nestedReadyReceivers.iterator();
                while (receiverIterator.hasNext()) {
                  RendezvousReceiver receiver=(RendezvousReceiver)receiverIterator.next();
                  Receiver[][][] symmetricReceivers=new Receiver[][][]{receiver._symmetricGetReceivers,receiver._symmetricPutReceivers};
                  for (int k=0; k < 2; k++) {
                    if (symmetricReceivers[k] != null) {
                      Set newCheckedReceivers=_receiversReadyToCommitRecursive(symmetricReceivers[k],k == 1,newReadyReceivers);
                      if (newCheckedReceivers == null) {
                        newReadyReceivers.clear();
                        break;
                      }
 else {
                        newReadyReceivers.addAll(newCheckedReceivers);
                      }
                    }
                  }
                  if (newReadyReceivers.isEmpty()) {
                    checkedReceivers.clear();
                    break;
                  }
 else {
                    checkedReceivers.addAll(newReadyReceivers);
                  }
                }
                if (checkedReceivers.isEmpty()) {
                  break;
                }
              }
            }
          }
        }
      }
      if ((isConditional && (checkedReceivers.size() > 0)) || (!isConditional && (checkedReceivers.isEmpty()))) {
        break;
      }
    }
  }
  return (checkedReceivers.size() > 0) ? checkedReceivers : null;
}