Program: 76216
Project: 76216
Buggy source:
/** 
 * Send the specified token to all receivers connected to the specified channel.  Tokens are in general immutable, so each receiver is given a reference to the same token and no clones are made. If the port is not connected to anything, or receivers have not been created in the remote port, or the channel index is out of range, or the port is not an output port, then just silently return.  This behavior makes it easy to leave output ports unconnected when you are not interested in the output.  The transfer is accomplished by calling the put() method of the remote receivers. If the port is not connected to anything, or receivers have not been created in the remote port, then just return. <p> Some of this method is read-synchronized on the workspace. Since it is possible for a thread to block while executing a put, it is important that the thread does not hold read access on the workspace when it is blocked. Thus this method releases read access on the workspace before calling put.
 * @param channelindex The index of the channel, from 0 to width-1
 * @param token The token to send
 * @exception NoRoomException If there is no room in the receiver.
 * @exception IllegalActionException Not thrown in this base class.
 */
public void send(int channelindex,Token token) throws IllegalActionException, NoRoomException {
  Receiver[][] farRec;
  try {
    try {
      _workspace.getReadAccess();
      farRec=getRemoteReceivers();
      if (farRec == null || farRec[channelindex] == null)       return;
    }
  finally {
      _workspace.doneReading();
    }
    for (int j=0; j < farRec[channelindex].length; j++) {
      farRec[channelindex][j].put(token);
    }
  }
 catch (  ArrayIndexOutOfBoundsException ex) {
  }
}

Fixed version (ground truth):
/** 
 * Send the specified token to all receivers connected to the specified channel.  Tokens are in general immutable, so each receiver is given a reference to the same token and no clones are made. If the port is not connected to anything, or receivers have not been created in the remote port, or the channel index is out of range, or the port is not an output port, then just silently return.  This behavior makes it easy to leave output ports unconnected when you are not interested in the output.  The transfer is accomplished by calling the put() method of the remote receivers. If the port is not connected to anything, or receivers have not been created in the remote port, then just return. <p> Some of this method is read-synchronized on the workspace. Since it is possible for a thread to block while executing a put, it is important that the thread does not hold read access on the workspace when it is blocked. Thus this method releases read access on the workspace before calling put.
 * @param channelIndex The index of the channel, from 0 to width-1
 * @param token The token to send
 * @exception NoRoomException If there is no room in the receiver.
 * @exception IllegalActionException Not thrown in this base class.
 */
public void send(int channelIndex,Token token) throws IllegalActionException, NoRoomException {
  Receiver[][] farRec;
  try {
    try {
      _workspace.getReadAccess();
      farRec=getRemoteReceivers();
      if (farRec == null || farRec[channelIndex] == null)       return;
    }
  finally {
      _workspace.doneReading();
    }
    for (int j=0; j < farRec[channelIndex].length; j++) {
      farRec[channelIndex][j].put(token);
    }
  }
 catch (  ArrayIndexOutOfBoundsException ex) {
  }
}