Program: 72461
Project: 72461
Buggy source:
/** 
 * Send data through the web socket.
 * @param msg A message to be sent.
 * @exception IllegalActionException If establishing the connection to the web socket haspermanently failed.
 */
public void send(Object msg) throws IllegalActionException {
synchronized (_actor) {
    if (_wsFailed != null) {
      throw new IllegalActionException(_actor,_wsFailed,"String_Node_Str" + _numberOfTries + "String_Node_Str");
    }
    if (!(msg instanceof String)) {
      if (msg instanceof ImageToken) {
        Image image=((ImageToken)msg).asAWTImage();
        if (!(image instanceof BufferedImage)) {
          throw new IllegalActionException(_actor,"String_Node_Str" + image.getClass());
        }
        if (!_sendType.startsWith("String_Node_Str")) {
          throw new IllegalActionException(_actor,"String_Node_Str" + _sendType);
        }
        String imageType=_sendType.substring(6);
        ByteArrayOutputStream stream=new ByteArrayOutputStream();
        try {
          ImageIO.write((BufferedImage)image,imageType,stream);
        }
 catch (        IOException e) {
          throw new IllegalActionException(_actor,e,"String_Node_Str");
        }
        msg=new Buffer(stream.toByteArray());
      }
    }
    if (isOpen()) {
      _sendMessageOverSocket(msg);
    }
 else     if (!_discardMessagesBeforeOpen) {
      if (_pendingOutputs == null) {
        _pendingOutputs=new LinkedList();
      }
      _pendingOutputs.add(msg);
      if (_throttleFactor > 0) {
        try {
          Thread.sleep(_throttleFactor * _pendingOutputs.size());
        }
 catch (        InterruptedException e) {
        }
      }
    }
 else {
      _actor.log("String_Node_Str" + msg);
    }
  }
}

Fixed version (ground truth):
/** 
 * Send data through the web socket.
 * @param msg A message to be sent.
 * @exception IllegalActionException If establishing the connection to the web socket haspermanently failed.
 */
public void send(Object msg) throws IllegalActionException {
synchronized (_actor) {
    if (_wsFailed != null) {
      throw new IllegalActionException(_actor,_wsFailed,"String_Node_Str" + _numberOfTries + "String_Node_Str");
    }
    if (!(msg instanceof String)) {
      if (msg instanceof ImageToken) {
        Image image=((ImageToken)msg).asAWTImage();
        if (!(image instanceof BufferedImage)) {
          throw new IllegalActionException(_actor,"String_Node_Str" + image.getClass());
        }
        if (!_sendType.startsWith("String_Node_Str")) {
          throw new IllegalActionException(_actor,"String_Node_Str" + _sendType);
        }
        String imageType=_sendType.substring(6);
        ByteArrayOutputStream stream=new ByteArrayOutputStream();
        try {
          ImageIO.write((BufferedImage)image,imageType,stream);
        }
 catch (        IOException e) {
          throw new IllegalActionException(_actor,e,"String_Node_Str");
        }
        msg=Buffer.buffer(stream.toByteArray());
      }
    }
    if (isOpen()) {
      _sendMessageOverSocket(msg);
    }
 else     if (!_discardMessagesBeforeOpen) {
      if (_pendingOutputs == null) {
        _pendingOutputs=new LinkedList();
      }
      _pendingOutputs.add(msg);
      if (_throttleFactor > 0) {
        try {
          Thread.sleep(_throttleFactor * _pendingOutputs.size());
        }
 catch (        InterruptedException e) {
        }
      }
    }
 else {
      _actor.log("String_Node_Str" + msg);
    }
  }
}