Program: 74833
Project: 74833
Buggy source:
/** 
 * Make all connections for this nested actor.
 * @param actor The actor for to connect to others.
 * @exception PtalonRuntimeException If thrown trying to access the parameter,or if unable to set the token for the corresponding paramter.
 */
public void makeConnections(ComponentEntity actor) throws PtalonRuntimeException {
  try {
    for (    String portName : _relations.keySet()) {
      String relationName=_actor.getMappedName(_relations.get(portName));
      TypedIORelation relation=(TypedIORelation)_actor.getRelation(relationName);
      TypedIOPort port=(TypedIOPort)actor.getPort(portName);
      port.link(relation);
    }
    for (    String portName : _ports.keySet()) {
      TypedIOPort port=(TypedIOPort)actor.getPort(portName);
      String containerPortName=_actor.getMappedName(_ports.get(portName));
      TypedIOPort containerPort=(TypedIOPort)_actor.getPort(containerPortName);
      String relationName=_actor.uniqueName("String_Node_Str");
      TypedIORelation relation=new TypedIORelation(_actor,relationName);
      port.link(relation);
      containerPort.link(relation);
    }
    PtalonActor container=(PtalonActor)actor.getContainer();
    for (    Object port : actor.portList()) {
      if (port instanceof TypedIOPort) {
        TypedIOPort ioport=(TypedIOPort)port;
        if (ioport.numLinks() == 0) {
          String name=container.uniqueName(actor.getName() + "String_Node_Str" + ioport.getName());
          TypedIOPort newPort=new TypedIOPort(container,name);
          String rel=container.uniqueName("String_Node_Str");
          TypedIORelation relation=new TypedIORelation(container,rel);
          if (ioport.isMultiport()) {
            relation.setWidth(ioport.getWidth());
            newPort.setMultiport(true);
            if (ioport.getWidth() == 0) {
              ioport.link(relation);
              newPort.link(relation);
            }
 else {
              int width=ioport.getWidth();
              while (width > 0) {
                ioport.link(relation);
                newPort.link(relation);
                width--;
              }
            }
          }
 else {
            ioport.link(relation);
            newPort.link(relation);
          }
        }
      }
    }
  }
 catch (  Exception e) {
    throw new PtalonRuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Make all connections for this nested actor.
 * @param actor The actor for to connect to others.
 * @exception PtalonRuntimeException If thrown trying to access the parameter,or if unable to set the token for the corresponding paramter.
 */
public void makeConnections(ComponentEntity actor) throws PtalonRuntimeException {
  try {
    for (    String portName : _relations.keySet()) {
      String relationName=_actor.getMappedName(_relations.get(portName));
      TypedIORelation relation=(TypedIORelation)_actor.getRelation(relationName);
      TypedIOPort port=(TypedIOPort)actor.getPort(portName);
      port.link(relation);
    }
    for (    String portName : _ports.keySet()) {
      TypedIOPort port=(TypedIOPort)actor.getPort(portName);
      String containerPortName=_actor.getMappedName(_ports.get(portName));
      TypedIOPort containerPort=(TypedIOPort)_actor.getPort(containerPortName);
      String relationName=_actor.uniqueName("String_Node_Str");
      TypedIORelation relation=new TypedIORelation(_actor,relationName);
      port.link(relation);
      containerPort.link(relation);
    }
    for (    String portName : _unknownPrefixes.keySet()) {
      String suffix=evaluateString(_unknownExpressions.get(portName));
      if (suffix == null) {
        throw new PtalonRuntimeException("String_Node_Str" + _unknownExpressions.get(portName));
      }
      String name=_unknownPrefixes.get(portName) + suffix;
      if (getType(name).endsWith("String_Node_Str")) {
        TypedIOPort port=(TypedIOPort)actor.getPort(portName);
        String containerPortName=_actor.getMappedName(name);
        TypedIOPort containerPort=(TypedIOPort)_actor.getPort(containerPortName);
        String relationName=_actor.uniqueName("String_Node_Str");
        TypedIORelation relation=new TypedIORelation(_actor,relationName);
        port.link(relation);
        containerPort.link(relation);
      }
 else       if (getType(name).equals("String_Node_Str")) {
        String relationName=_actor.getMappedName(name);
        TypedIORelation relation=(TypedIORelation)_actor.getRelation(relationName);
        TypedIOPort port=(TypedIOPort)actor.getPort(portName);
        port.link(relation);
      }
 else {
        throw new PtalonRuntimeException(name + "String_Node_Str");
      }
    }
    PtalonActor container=(PtalonActor)actor.getContainer();
    for (    Object port : actor.portList()) {
      if (port instanceof TypedIOPort) {
        TypedIOPort ioport=(TypedIOPort)port;
        if (ioport.numLinks() == 0) {
          String name=container.uniqueName(actor.getName() + "String_Node_Str" + ioport.getName());
          TypedIOPort newPort=new TypedIOPort(container,name);
          String rel=container.uniqueName("String_Node_Str");
          TypedIORelation relation=new TypedIORelation(container,rel);
          if (ioport.isMultiport()) {
            relation.setWidth(ioport.getWidth());
            newPort.setMultiport(true);
            if (ioport.getWidth() == 0) {
              ioport.link(relation);
              newPort.link(relation);
            }
 else {
              int width=ioport.getWidth();
              while (width > 0) {
                ioport.link(relation);
                newPort.link(relation);
                width--;
              }
            }
          }
 else {
            ioport.link(relation);
            newPort.link(relation);
          }
        }
      }
    }
  }
 catch (  Exception e) {
    throw new PtalonRuntimeException("String_Node_Str",e);
  }
}