Program: 76635
Project: 76635
Buggy source:
/** 
 * Override parent method to ensure validity of the width of the port. If the given relation is already linked to this port or the argument is null, do nothing. Otherwise, create a new link or throw an exception if the link is invalid.  If this port is not a multiport, then the width of the relation is required to be specified at exactly one. To prohibit links across levels of the hierarchy, use link(). This method is synchronized on the workspace and increments its version.
 * @exception IllegalActionException If the port already linked to arelation and is not a multiport; or if the relation has width not exactly one and the port is not a multiport; or if the  relation is incompatible with this port; or if the port has no container; or the port is not in the same workspace as the relation.
 */
public void liberalLink(Relation relation) throws IllegalActionException {
synchronized (workspace()) {
    _checkRelation(relation);
    IORelation rel=(IORelation)relation;
    if (!isLinked(rel)) {
      boolean insidelink=_outside(relation.getContainer());
      if (!isMultiport()) {
        if ((insidelink && numInsideLinks() >= 1) || (!insidelink && numLinks() >= 1)) {
          throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
        }
      }
      if ((rel.getWidth() != 1) || !rel.widthFixed()) {
        if (!isMultiport()) {
          throw new IllegalActionException(this,rel,"String_Node_Str");
        }
        if (insidelink) {
          try {
            _getInsideWidth(null);
          }
 catch (          InvalidStateException ex) {
            throw new IllegalActionException(this,rel,"String_Node_Str" + "String_Node_Str");
          }
        }
      }
      super.liberalLink(rel);
    }
  }
}

Fixed version (ground truth):
/** 
 * Override parent method to ensure validity of the width of the port. If the given relation is already linked to this port from the  inside or the outside, or the argument is null, do nothing. Otherwise, create a new link or throw an exception if the link is invalid.  If this port is not a multiport, then the width of the relation is required to be specified at exactly one. To prohibit links across levels of the hierarchy, use link(). This method is synchronized on the workspace and increments its version.
 * @exception IllegalActionException If the port already linked to arelation and is not a multiport; or if the relation has width not exactly one and the port is not a multiport; or if the  relation is incompatible with this port; or if the port has no container; or the port is not in the same workspace as the relation.
 */
public void liberalLink(Relation relation) throws IllegalActionException {
synchronized (workspace()) {
    _checkRelation(relation);
    IORelation rel=(IORelation)relation;
    if (!isLinked(rel) && !isInsideLinked(rel)) {
      boolean insidelink=_outside(relation.getContainer());
      if (!isMultiport()) {
        if ((insidelink && numInsideLinks() >= 1) || (!insidelink && numLinks() >= 1)) {
          throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
        }
      }
      if ((rel.getWidth() != 1) || !rel.widthFixed()) {
        if (!isMultiport()) {
          throw new IllegalActionException(this,rel,"String_Node_Str");
        }
        if (insidelink) {
          try {
            _getInsideWidth(null);
          }
 catch (          InvalidStateException ex) {
            throw new IllegalActionException(this,rel,"String_Node_Str" + "String_Node_Str");
          }
        }
 else {
          Enumeration relations=linkedRelations();
          while (relations.hasMoreElements()) {
            IORelation r=(IORelation)relations.nextElement();
            if (!r.widthFixed()) {
              throw new IllegalActionException(this,rel,"String_Node_Str" + "String_Node_Str");
            }
          }
        }
      }
      super.liberalLink(rel);
    }
  }
}