Program: 75705
Project: 75705
Buggy source:
/** 
 * Preinitialize this actor.  This method is used as a bookend with wrapup() being the other end.  Resources are allocated here and released in wrapup().  Create a new datagram socket and initialize the thread that reads from that socket.  Also create an evaluation variable <i>_evalVar</i>for the Ptolemy parser.  The thread will stay alive even if the socket is closed.  However, it terminates when the socket becomes null. Only wrapup() makes the socket null.
 * @exception IllegalActionException If the<i>localSocketNumber</i> parameter has a value outside 0..65535 or a socket could not be created.
 */
public void preinitialize() throws IllegalActionException {
  super.preinitialize();
  if (_debugging)   _debug(this + "String_Node_Str");
  _packetsAlreadyAwaitingFire=0;
  Variable var=(Variable)getAttribute("String_Node_Str");
  if (var == null) {
    try {
      var=new Variable(this,"String_Node_Str");
    }
 catch (    NameDuplicationException ex) {
      throw new IllegalActionException("String_Node_Str");
    }
  }
  _evalVar=var;
  int portNumber=((IntToken)(localSocketNumber.getToken())).intValue();
  if (portNumber < 0 || portNumber > 65535) {
    throw new IllegalActionException(this,localSocketNumber + "String_Node_Str");
  }
  if (_debugging)   _debug(this + "String_Node_Str" + portNumber);
  try {
    if (false && _debugging) {
      _debug("String_Node_Str" + portNumber);
    }
    _socket=new DatagramSocket(portNumber);
    if (false && _debugging) {
      _debug("String_Node_Str");
    }
  }
 catch (  SocketException ex) {
    throw new IllegalActionException(this,"String_Node_Str" + ex);
  }
  _listenerThread=new ListenerThread();
  _listenerThread.start();
  if (_debugging)   _debug("String_Node_Str");
  if (_debugging)   _debug("String_Node_Str");
  if (_debugging)   _debug("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Preinitialize this actor.  This method is used as a bookend with wrapup() being the other end.  Resources are allocated here and released in wrapup().  Create a new datagram socket and initialize the thread that reads from that socket.  Also create an evaluation variable <i>_evalVar</i>for the Ptolemy parser.  The thread will stay alive even if the socket is closed.  However, it terminates when the socket becomes null. Only wrapup() makes the socket null.
 * @exception IllegalActionException If the<i>localSocketNumber</i> parameter has a value outside 0..65535 or a socket could not be created.
 */
public void preinitialize() throws IllegalActionException {
  super.preinitialize();
  if (_debugging)   _debug(this + "String_Node_Str");
  _packetsAlreadyAwaitingFire=0;
  Variable var=(Variable)getAttribute("String_Node_Str");
  if (var == null) {
    try {
      var=new Variable(this,"String_Node_Str");
    }
 catch (    NameDuplicationException ex) {
      throw new IllegalActionException("String_Node_Str");
    }
  }
  _evalVar=var;
  int portNumber=((IntToken)(localSocketNumber.getToken())).intValue();
  if (portNumber < 0 || portNumber > 65535) {
    throw new IllegalActionException(this,localSocketNumber + "String_Node_Str");
  }
  if (_debugging)   _debug(this + "String_Node_Str" + portNumber);
  try {
    if (false && _debugging) {
      _debug("String_Node_Str" + portNumber);
    }
    _socket=new DatagramSocket(portNumber);
    if (false && _debugging) {
      _debug("String_Node_Str");
    }
  }
 catch (  SocketException ex) {
    throw new IllegalActionException(this,"String_Node_Str" + ex);
  }
  try {
    int socketSize=_socket.getReceiveBufferSize();
    System.out.println("String_Node_Str" + socketSize);
    if (platformBufferLength.getToken() != null) {
      _socket.setReceiveBufferSize(((IntToken)platformBufferLength.getToken()).intValue());
    }
    platformBufferLength.setToken(new IntToken(_socket.getReceiveBufferSize()));
    System.out.println("String_Node_Str" + _socket.getReceiveBufferSize());
  }
 catch (  SocketException sex) {
    System.out.println("String_Node_Str" + sex.toString());
  }
  _listenerThread=new ListenerThread();
  _listenerThread.start();
  if (_debugging)   _debug("String_Node_Str");
  if (_debugging)   _debug("String_Node_Str");
  if (_debugging)   _debug("String_Node_Str");
}