Program: 76206
Project: 76206
Buggy source:
/** 
 * Get a token from the specified channel. If the channel has a group with more than one receiver (something that is possible if this is a transparent port), then this method calls get() on all receivers, but returns only the first non-null token returned by these calls. Normally this method is not used on transparent ports. If there is no token to return, then throw an exception. <p> Some of this method is read-synchronized on the workspace. Since it is possible for a thread to block while executing a get, 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 get.
 * @param channelindex The channel index.
 * @return A token from the specified channel.
 * @exception NoTokenException If there is no token.
 * @exception IllegalActionException If there is no director, and henceno receivers have been created, if the port is not an input port, or if the channel index is out of range.
 */
public Token get(int channelindex) throws NoTokenException, IllegalActionException {
  Receiver[][] localRec;
  try {
    try {
      _workspace.getReadAccess();
      localRec=getReceivers();
      if (localRec[channelindex] == null) {
        throw new NoTokenException(this,"String_Node_Str" + channelindex + "String_Node_Str");
      }
    }
  finally {
      _workspace.doneReading();
    }
    Token tt=null;
    for (int j=0; j < localRec[channelindex].length; j++) {
      Token ttt=localRec[channelindex][j].get();
      if (tt == null)       tt=ttt;
    }
    if (tt == null) {
      throw new NoTokenException(this,"String_Node_Str");
    }
    return tt;
  }
 catch (  ArrayIndexOutOfBoundsException ex) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Get a token from the specified channel. If the channel has a group with more than one receiver (something that is possible if this is a transparent port), then this method calls get() on all receivers, but returns only the first non-null token returned by these calls. Normally this method is not used on transparent ports. If there is no token to return, then throw an exception. <p> Some of this method is read-synchronized on the workspace. Since it is possible for a thread to block while executing a get, 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 get.
 * @param channelIndex The channel index.
 * @return A token from the specified channel.
 * @exception NoTokenException If there is no token.
 * @exception IllegalActionException If there is no director, and henceno receivers have been created, if the port is not an input port, or if the channel index is out of range.
 */
public Token get(int channelIndex) throws NoTokenException, IllegalActionException {
  Receiver[][] localRec;
  try {
    try {
      _workspace.getReadAccess();
      localRec=getReceivers();
      if (localRec[channelIndex] == null) {
        throw new NoTokenException(this,"String_Node_Str" + channelIndex + "String_Node_Str");
      }
    }
  finally {
      _workspace.doneReading();
    }
    Token tt=null;
    for (int j=0; j < localRec[channelIndex].length; j++) {
      Token ttt=localRec[channelIndex][j].get();
      if (tt == null)       tt=ttt;
    }
    if (tt == null) {
      throw new NoTokenException(this,"String_Node_Str");
    }
    return tt;
  }
 catch (  ArrayIndexOutOfBoundsException ex) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}