Program: 72506
Project: 72506
Buggy source:
/** 
 * Expose the send() method of the port.
 * @param channelIndex The channel index.
 * @param data The token to send.
 * @throws IllegalActionException If this is a proxy for a parameter or if sending fails.
 * @throws NoRoomException If there is no room at the destination.
 */
public void send(int channelIndex,Token data) throws NoRoomException, IllegalActionException {
  if (_port == null) {
    throw new IllegalActionException(JavaScript.this,"String_Node_Str" + _parameter.getName() + "String_Node_Str");
  }
  if (!_executing) {
    throw new InternalErrorException("String_Node_Str" + data + "String_Node_Str"+ _port.getName()+ "String_Node_Str");
  }
synchronized (JavaScript.this) {
    if (!_port.isOutput()) {
      if (!_port.isInput()) {
        throw new IllegalActionException(JavaScript.this,"String_Node_Str");
      }
      if (_localInputTokens == null) {
        _localInputTokens=new LinkedList<Token>();
      }
      _localInputTokens.add(data);
      _fireAtCurrentTime();
    }
 else     if (_inFire) {
      if (_debugging) {
        _debug("String_Node_Str" + data + "String_Node_Str"+ _port.getName());
      }
      _port.send(channelIndex,data);
    }
 else {
      if (_outputTokens == null) {
        _outputTokens=new HashMap<IOPort,HashMap<Integer,List<Token>>>();
      }
      HashMap<Integer,List<Token>> tokens=_outputTokens.get(_port);
      if (tokens == null) {
        tokens=new HashMap<Integer,List<Token>>();
        _outputTokens.put(_port,tokens);
      }
      List<Token> queue=tokens.get(channelIndex);
      if (queue == null) {
        queue=new LinkedList<Token>();
        tokens.put(channelIndex,queue);
      }
      queue.add(data);
      if (_debugging) {
        _debug("String_Node_Str" + data + "String_Node_Str"+ _port.getName()+ "String_Node_Str");
      }
      getDirector().fireAtCurrentTime(JavaScript.this);
    }
  }
}

Fixed version (ground truth):
/** 
 * Expose the send() method of the port.
 * @param channelIndex The channel index.
 * @param data The token to send.
 * @throws IllegalActionException If this is a proxy for a parameter or if sending fails.
 * @throws NoRoomException If there is no room at the destination.
 */
public void send(int channelIndex,Token data) throws NoRoomException, IllegalActionException {
  if (_port == null) {
    throw new IllegalActionException(JavaScript.this,"String_Node_Str" + _parameter.getName() + "String_Node_Str");
  }
  if (getManager().getState() == ptolemy.actor.Manager.WRAPPING_UP) {
    System.err.println("String_Node_Str" + data);
    return;
  }
synchronized (JavaScript.this) {
    if (!_executing) {
      throw new InternalErrorException("String_Node_Str" + data + "String_Node_Str"+ _port.getName()+ "String_Node_Str");
    }
    if (!_port.isOutput()) {
      if (!_port.isInput()) {
        throw new IllegalActionException(JavaScript.this,"String_Node_Str");
      }
      if (_localInputTokens == null) {
        _localInputTokens=new LinkedList<Token>();
      }
      _localInputTokens.add(data);
      _fireAtCurrentTime();
    }
 else     if (_inFire) {
      if (_debugging) {
        _debug("String_Node_Str" + data + "String_Node_Str"+ _port.getName());
      }
      _port.send(channelIndex,data);
    }
 else {
      if (_outputTokens == null) {
        _outputTokens=new HashMap<IOPort,HashMap<Integer,List<Token>>>();
      }
      HashMap<Integer,List<Token>> tokens=_outputTokens.get(_port);
      if (tokens == null) {
        tokens=new HashMap<Integer,List<Token>>();
        _outputTokens.put(_port,tokens);
      }
      List<Token> queue=tokens.get(channelIndex);
      if (queue == null) {
        queue=new LinkedList<Token>();
        tokens.put(channelIndex,queue);
      }
      queue.add(data);
      if (_debugging) {
        _debug("String_Node_Str" + data + "String_Node_Str"+ _port.getName()+ "String_Node_Str");
      }
      getDirector().fireAtCurrentTime(JavaScript.this);
    }
  }
}