Program: 75516
Project: 75516
Buggy source:
/** 
 * Check that a port that is not a multiport will not have too many links if a link is established with the specified relation.
 * @exception IllegalActionException If the port will have too manylinks.
 */
private void _checkMultiportLink(IORelation relation) throws IllegalActionException {
  if (_isInsideLinkable(relation.getContainer())) {
    if (!isInsideLinked(relation)) {
      if (!isMultiport() && numInsideLinks() >= 1) {
        throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str");
      }
      if ((relation.getWidth() != 1) || !relation.isWidthFixed()) {
        if (!isMultiport()) {
          throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str");
        }
        if (!relation.isWidthFixed()) {
          try {
            _getInsideWidth(null);
          }
 catch (          InvalidStateException ex) {
            throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          }
        }
      }
    }
  }
 else {
    if (!isLinked(relation)) {
      if (!isMultiport() && numLinks() >= 1) {
        throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str");
      }
      if (relation.getWidth() != 1 || !relation.isWidthFixed()) {
        if (!isMultiport()) {
          throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str");
        }
        Iterator relations=linkedRelationList().iterator();
        while (relations.hasNext()) {
          IORelation theRelation=(IORelation)relations.next();
          if (theRelation != null && !theRelation.isWidthFixed()) {
            throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Check that a port that is not a multiport will not have too many links if a link is established with the specified relation.
 * @exception IllegalActionException If the port will have too manylinks.
 */
private void _checkMultiportLink(IORelation relation) throws IllegalActionException {
  if (_isInsideLinkable(relation.getContainer())) {
    if (!isMultiport() && numInsideLinks() >= 1) {
      throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str");
    }
    if ((relation.getWidth() != 1) || !relation.isWidthFixed()) {
      if (!isMultiport()) {
        throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str");
      }
      if (!relation.isWidthFixed()) {
        try {
          _getInsideWidth(null);
        }
 catch (        InvalidStateException ex) {
          throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        }
      }
    }
  }
 else {
    if (!isMultiport() && numLinks() >= 1) {
      throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str");
    }
    if (relation.getWidth() != 1 || !relation.isWidthFixed()) {
      if (!isMultiport()) {
        throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str");
      }
      Iterator relations=linkedRelationList().iterator();
      while (relations.hasNext()) {
        IORelation theRelation=(IORelation)relations.next();
        if (theRelation != null && !theRelation.isWidthFixed()) {
          throw new IllegalActionException(this,relation,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        }
      }
    }
  }
}