Program: 75504
Project: 75504
Buggy source:
/** 
 * Create a guarded communication with a send communication.
 * @param guard The guard for the guarded communication statementrepresented by this object.
 * @param port The IOPort containing the channel (and thus receiver)that this branch will try to rendezvous with.
 * @param channel The channel in the IOPort that this branch istrying to rendezvous with.
 * @param branchID The identification number assigned to this branchupon creation by the CSPActor.
 * @param token The token this branch is trying to send.
 * @exception IllegalActionException If the channel has morethan one receiver or if the receiver is not of type CSPReceiver.
 */
public ConditionalSend(boolean guard,IOPort port,int channel,int branchID,Token token,ConditionalBranchController cbc) throws IllegalActionException {
  super(guard,port,branchID,cbc);
  Receiver[][] receivers;
  try {
    port.workspace().getReadAccess();
    if (!port.isOutput()) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str");
    }
    if (channel >= port.getWidth() || channel < 0) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str");
    }
    receivers=port.getRemoteReceivers();
    if (receivers == null || receivers[channel] == null) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str");
    }
    if (receivers[channel].length != 1) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str" + channel + "String_Node_Str"+ "String_Node_Str");
    }
    if (!(receivers[channel][0] instanceof CSPReceiver)) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str" + channel + "String_Node_Str"+ "String_Node_Str");
    }
    setReceiver((CSPReceiver)receivers[channel][0]);
  }
  finally {
    port.workspace().doneReading();
  }
  setToken(token);
}

Fixed version (ground truth):
/** 
 * Create a guarded communication with a send communication. This constructor allows actors which are not CSPActors access to CSP functionality by providing their own ConditionalBranchController.
 * @param guard The guard for the guarded communication statementrepresented by this object.
 * @param port The IOPort containing the channel (and thus receiver)that this branch will try to rendezvous with.
 * @param channel The channel in the IOPort that this branch istrying to rendezvous with.
 * @param branchID The identification number assigned to this branchupon creation by the CSPActor.
 * @param token The token this branch is trying to send.
 * @param cbc The ConditionalBranchController that this branch uses.
 * @exception IllegalActionException If the channel has morethan one receiver or if the receiver is not of type CSPReceiver.
 */
public ConditionalSend(boolean guard,IOPort port,int channel,int branchID,Token token,ConditionalBranchController cbc) throws IllegalActionException {
  super(guard,port,branchID,cbc);
  Receiver[][] receivers;
  try {
    port.workspace().getReadAccess();
    if (!port.isOutput()) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str");
    }
    if (channel >= port.getWidth() || channel < 0) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str");
    }
    receivers=port.getRemoteReceivers();
    if (receivers == null || receivers[channel] == null) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str");
    }
    if (receivers[channel].length != 1) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str" + channel + "String_Node_Str"+ "String_Node_Str");
    }
    if (!(receivers[channel][0] instanceof CSPReceiver)) {
      throw new IllegalActionException(port,"String_Node_Str" + "String_Node_Str" + channel + "String_Node_Str"+ "String_Node_Str");
    }
    setReceiver((CSPReceiver)receivers[channel][0]);
  }
  finally {
    port.workspace().doneReading();
  }
  setToken(token);
}