Program: 76597
Project: 76597
Buggy source:
/** 
 * Create receivers for this port. This method should only be  called on input ports. It should also normally only be called  during the initialize and prefire methods of the director. If this port already has the correct number of receivers, then no new receivers are created. However if new receivers are created,  then any receivers this port previously had will be overwritten. It is <i>not</i> write-synchronized on the workspace, so the caller should be. 
 * @exception IllegalActionException Thrown if this port is not an opaque input port or if there is no director.
 */
public void createReceivers() throws IllegalActionException {
  if (!(isInput() && isOpaque())) {
    String message="String_Node_Str";
    message+="String_Node_Str";
    throw new IllegalActionException(this,message);
  }
  int portWidth=getWidth();
  if (portWidth <= 0)   return;
  if (_localReceiversTable == null) {
    _localReceiversTable=new Hashtable();
  }
  Enumeration relations=linkedRelations();
  while (relations.hasMoreElements()) {
    IORelation relation=(IORelation)relations.nextElement();
    boolean insideLink=isInsideLinked(relation);
    int width=relation.getWidth();
    Receiver[][] result=null;
    if (_localReceiversTable.containsKey(relation)) {
      result=(Receiver[][])_localReceiversTable.get(relation);
    }
    if ((result == null) || (result.length != width)) {
      result=new Receiver[width][1];
      if (insideLink) {
        for (int i=0; i < width; i++) {
          result[i][0]=_newInsideReceiver();
        }
      }
 else {
        for (int i=0; i < width; i++) {
          result[i][0]=_newReceiver();
        }
      }
      _localReceiversTable.put(relation,result);
    }
  }
}

Fixed version (ground truth):
/** 
 * Create receivers for this port. This method should only be  called on input ports. It should also normally only be called  during the initialize and prefire methods of the director. If this port already has the correct number of receivers, then no new receivers are created. However if new receivers are created,  then any receivers this port previously had will be overwritten. <p> Receivers are created if neccessary for each relation connected  to the port. There are two cases where receivers need to be  created: First whenever a port is an input port, and second  whenever the port is an output, opaque port and the relation connects to it from the inside. If neither of these cases apply to a relation, no receivers are created. It is <i>not</i> write-synchronized on the workspace, so the caller should be. 
 * @exception IllegalActionException Thrown if this port is not an opaque input port or if there is no director.
 */
public void createReceivers() throws IllegalActionException {
  if (!isOpaque()) {
    String message="String_Node_Str";
    message+="String_Node_Str";
    throw new IllegalActionException(this,message);
  }
  int portWidth=getWidth();
  if (portWidth <= 0)   return;
  if (_localReceiversTable == null) {
    _localReceiversTable=new Hashtable();
  }
  boolean input=isInput();
  boolean output=isOutput();
  Enumeration outsideRelations=linkedRelations();
  Enumeration insideRelations=insideRelations();
  if (input) {
    while (outsideRelations.hasMoreElements()) {
      IORelation relation=(IORelation)outsideRelations.nextElement();
      int width=relation.getWidth();
      Receiver[][] result=null;
      if (_localReceiversTable.containsKey(relation)) {
        result=(Receiver[][])_localReceiversTable.get(relation);
      }
      if ((result == null) || (result.length != width)) {
        result=new Receiver[width][1];
        for (int i=0; i < width; i++) {
          result[i][0]=_newReceiver();
        }
      }
      _localReceiversTable.put(relation,result);
    }
  }
 else   if (output) {
    while (insideRelations.hasMoreElements()) {
      IORelation relation=(IORelation)insideRelations.nextElement();
      int width=relation.getWidth();
      Receiver[][] result=null;
      if (_localReceiversTable.containsKey(relation)) {
        result=(Receiver[][])_localReceiversTable.get(relation);
      }
      if ((result == null) || (result.length != width)) {
        result=new Receiver[width][1];
        for (int i=0; i < width; i++) {
          result[i][0]=_newInsideReceiver();
        }
      }
      _localReceiversTable.put(relation,result);
    }
  }
}