Program: 74598
Project: 74598
Buggy source:
/** 
 * Call the base class to perform standard wrapup() functions, and, if this is the master copy, delete the clones of this actor created during   {@link #preinitialize()}.
 * @exception IllegalActionException Not thrown in this base class.
 */
public void wrapup() throws IllegalActionException {
  super.wrapup();
  if (_debugging) {
    _debug(getFullName() + "String_Node_Str");
  }
  if (!_isMasterCopy) {
    return;
  }
  TypedCompositeActor container=(TypedCompositeActor)getContainer();
  if (container == null) {
    return;
  }
  int i=1;
  while (true) {
    MultiInstanceComposite clone=(MultiInstanceComposite)container.getEntity(getName() + "String_Node_Str" + ++i);
    if (clone == null) {
      break;
    }
    Iterator ports=clone.portList().iterator();
    while (ports.hasNext()) {
      TypedIOPort port=(TypedIOPort)ports.next();
      Iterator relations=port.linkedRelationList().iterator();
      while (relations.hasNext()) {
        TypedIORelation relation=(TypedIORelation)relations.next();
        TypedIOPort mirrorPort=(TypedIOPort)getPort(port.getName());
        if (!port.isDeeplyConnected(mirrorPort)) {
          try {
            if (_debugging) {
              _debug("String_Node_Str" + relation.getFullName());
            }
            relation.setContainer(null);
          }
 catch (          NameDuplicationException ex) {
            throw new InternalErrorException(ex);
          }
        }
 else {
          if (_debugging) {
            _debug("String_Node_Str" + port.getFullName() + "String_Node_Str"+ relation.getFullName());
          }
          port.unlink(relation);
        }
      }
    }
    try {
      if (_debugging) {
        _debug("String_Node_Str" + clone.getFullName());
      }
      clone.setContainer(null);
    }
 catch (    NameDuplicationException ex) {
      throw new InternalErrorException(ex);
    }
  }
  StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str");
  buffer.append("String_Node_Str");
  MoMLChangeRequest request=new MoMLChangeRequest(this,container,buffer.toString());
  request.setPersistent(false);
  requestChange(request);
}

Fixed version (ground truth):
/** 
 * Call the base class to perform standard wrapup() functions, and, if this is the master copy, delete the clones of this actor created during   {@link #preinitialize()}.
 * @exception IllegalActionException Not thrown in this base class.
 */
public void wrapup() throws IllegalActionException {
  super.wrapup();
  if (_debugging) {
    _debug(getFullName() + "String_Node_Str");
  }
  if (!_isMasterCopy) {
    return;
  }
  TypedCompositeActor container=(TypedCompositeActor)getContainer();
  if (container == null) {
    return;
  }
  int i=1;
  while (true) {
    MultiInstanceComposite clone=(MultiInstanceComposite)container.getEntity(getName() + "String_Node_Str" + i);
    if (clone == null) {
      break;
    }
    ++i;
    Iterator ports=clone.portList().iterator();
    while (ports.hasNext()) {
      TypedIOPort port=(TypedIOPort)ports.next();
      Iterator relations=port.linkedRelationList().iterator();
      while (relations.hasNext()) {
        TypedIORelation relation=(TypedIORelation)relations.next();
        TypedIOPort mirrorPort=(TypedIOPort)getPort(port.getName());
        if (!port.isDeeplyConnected(mirrorPort)) {
          try {
            if (_debugging) {
              _debug("String_Node_Str" + relation.getFullName());
            }
            relation.setContainer(null);
          }
 catch (          NameDuplicationException ex) {
            throw new InternalErrorException(ex);
          }
        }
 else {
          if (_debugging) {
            _debug("String_Node_Str" + port.getFullName() + "String_Node_Str"+ relation.getFullName());
          }
          port.unlink(relation);
        }
      }
    }
    try {
      if (_debugging) {
        _debug("String_Node_Str" + clone.getFullName());
      }
      clone.setContainer(null);
    }
 catch (    NameDuplicationException ex) {
      throw new InternalErrorException(ex);
    }
  }
  StringBuffer buffer=new StringBuffer();
  buffer.append("String_Node_Str");
  buffer.append("String_Node_Str");
  MoMLChangeRequest request=new MoMLChangeRequest(this,container,buffer.toString());
  request.setPersistent(false);
  requestChange(request);
}