Program: 75565
Project: 75565
Buggy source:
/** 
 * Initialize this actor.  If the types stored in the type parameters do not correspond to the types of corresponding typeable objects in the model, then throw an exception indicating a failed regression test.
 * @exception IllegalActionException If the test fails.
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  ArrayList portActorNameList=new ArrayList();
  ArrayList parameterActorNameList=new ArrayList();
  ArrayList portAssignments=new ArrayList();
  ArrayList parameterAssignments=new ArrayList();
  List entityList=((CompositeEntity)getContainer()).entityList();
  for (Iterator i=entityList.iterator(); i.hasNext(); ) {
    ComponentEntity entity=(ComponentEntity)i.next();
    if (entity.equals(this)) {
      continue;
    }
    ArrayList portNames=new ArrayList();
    ArrayList portTypes=new ArrayList();
    for (Iterator ports=entity.portList().iterator(); ports.hasNext(); ) {
      TypedIOPort port=(TypedIOPort)ports.next();
      portNames.add(port.getName());
      portTypes.add(new StringToken(port.getType().toString()));
    }
    if (portNames.size() > 0) {
      portActorNameList.add(entity.getName());
      portAssignments.add(new RecordToken((String[])portNames.toArray(new String[portNames.size()]),(Token[])portTypes.toArray(new Token[portTypes.size()])));
    }
    ArrayList paramNames=new ArrayList();
    ArrayList paramTypes=new ArrayList();
    for (Iterator params=entity.attributeList(Parameter.class).iterator(); params.hasNext(); ) {
      Parameter param=(Parameter)params.next();
      paramNames.add(param.getName());
      paramTypes.add(new StringToken(param.getType().toString()));
    }
    if (paramNames.size() > 0) {
      parameterActorNameList.add(entity.getName());
      parameterAssignments.add(new RecordToken((String[])paramNames.toArray(new String[paramNames.size()]),(Token[])paramTypes.toArray(new Token[paramTypes.size()])));
    }
  }
  RecordToken actualPortTypes=new RecordToken((String[])portActorNameList.toArray(new String[portActorNameList.size()]),(Token[])portAssignments.toArray(new Token[portAssignments.size()]));
  RecordToken actualParameterTypes=new RecordToken((String[])parameterActorNameList.toArray(new String[parameterActorNameList.size()]),(Token[])parameterAssignments.toArray(new Token[parameterAssignments.size()]));
  if (((BooleanToken)trainingMode.getToken()).booleanValue()) {
    if (NonStrictTest.isRunningNightlyBuild()) {
      throw new IllegalActionException(this,NonStrictTest.TRAINING_MODE_ERROR_MESSAGE);
    }
 else {
      System.err.println("String_Node_Str" + this.getFullName() + "String_Node_Str"+ "String_Node_Str");
    }
    portTypes.setToken(actualPortTypes);
    parameterTypes.setToken(actualParameterTypes);
  }
 else {
    RecordToken correctPortTypes=(RecordToken)portTypes.getToken();
    RecordToken correctParameterTypes=(RecordToken)parameterTypes.getToken();
    for (Iterator actorNames=correctPortTypes.labelSet().iterator(); actorNames.hasNext(); ) {
      String actorName=(String)actorNames.next();
      RecordToken assignment=(RecordToken)correctPortTypes.get(actorName);
      for (Iterator names=assignment.labelSet().iterator(); names.hasNext(); ) {
        String name=(String)names.next();
        StringToken value=(StringToken)assignment.get(name);
        if (actualPortTypes == null) {
          throw new IllegalActionException(this,"String_Node_Str");
        }
        if (actualPortTypes.get(actorName) == null) {
          throw new IllegalActionException(this,"String_Node_Str" + actorName + "String_Node_Str"+ "String_Node_Str");
        }
        StringToken actualValue=(StringToken)((RecordToken)actualPortTypes.get(actorName)).get(name);
        if (!value.equals(actualValue)) {
          throw new IllegalActionException(this,"String_Node_Str" + ((CompositeEntity)getContainer()).getEntity(actorName).getFullName() + "String_Node_Str"+ name+ "String_Node_Str"+ value+ "String_Node_Str"+ actualValue+ "String_Node_Str");
        }
      }
    }
    for (Iterator actorNames=correctParameterTypes.labelSet().iterator(); actorNames.hasNext(); ) {
      String actorName=(String)actorNames.next();
      RecordToken assignment=(RecordToken)correctParameterTypes.get(actorName);
      for (Iterator names=assignment.labelSet().iterator(); names.hasNext(); ) {
        String name=(String)names.next();
        StringToken value=(StringToken)assignment.get(name);
        StringToken actualValue=(StringToken)((RecordToken)actualParameterTypes.get(actorName)).get(name);
        if (!value.equals(actualValue)) {
          throw new IllegalActionException(this,"String_Node_Str" + ((CompositeEntity)getContainer()).getEntity(actorName).getFullName() + "String_Node_Str"+ name+ "String_Node_Str"+ value+ "String_Node_Str"+ actualValue+ "String_Node_Str");
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Initialize this actor.  If the types stored in the type parameters do not correspond to the types of corresponding typeable objects in the model, then throw an exception indicating a failed regression test.
 * @exception IllegalActionException If the test fails.
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  ArrayList portActorNameList=new ArrayList();
  ArrayList parameterActorNameList=new ArrayList();
  ArrayList portAssignments=new ArrayList();
  ArrayList parameterAssignments=new ArrayList();
  List entityList=((CompositeEntity)getContainer()).entityList();
  for (Iterator i=entityList.iterator(); i.hasNext(); ) {
    ComponentEntity entity=(ComponentEntity)i.next();
    if (entity.equals(this)) {
      continue;
    }
    ArrayList portNames=new ArrayList();
    ArrayList portTypes=new ArrayList();
    for (Iterator ports=entity.portList().iterator(); ports.hasNext(); ) {
      TypedIOPort port=(TypedIOPort)ports.next();
      portNames.add(port.getName());
      portTypes.add(new StringToken(port.getType().toString()));
    }
    if (portNames.size() > 0) {
      portActorNameList.add(entity.getName());
      portAssignments.add(new RecordToken((String[])portNames.toArray(new String[portNames.size()]),(Token[])portTypes.toArray(new Token[portTypes.size()])));
    }
    ArrayList paramNames=new ArrayList();
    ArrayList paramTypes=new ArrayList();
    for (Iterator params=entity.attributeList(Parameter.class).iterator(); params.hasNext(); ) {
      Parameter param=(Parameter)params.next();
      paramNames.add(param.getName());
      paramTypes.add(new StringToken(param.getType().toString()));
    }
    if (paramNames.size() > 0) {
      parameterActorNameList.add(entity.getName());
      parameterAssignments.add(new RecordToken((String[])paramNames.toArray(new String[paramNames.size()]),(Token[])paramTypes.toArray(new Token[paramTypes.size()])));
    }
  }
  RecordToken actualPortTypes=new RecordToken((String[])portActorNameList.toArray(new String[portActorNameList.size()]),(Token[])portAssignments.toArray(new Token[portAssignments.size()]));
  RecordToken actualParameterTypes=new RecordToken((String[])parameterActorNameList.toArray(new String[parameterActorNameList.size()]),(Token[])parameterAssignments.toArray(new Token[parameterAssignments.size()]));
  if (((BooleanToken)trainingMode.getToken()).booleanValue()) {
    if (NonStrictTest.isRunningNightlyBuild()) {
      throw new IllegalActionException(this,NonStrictTest.TRAINING_MODE_ERROR_MESSAGE);
    }
 else {
      System.err.println("String_Node_Str" + this.getFullName() + "String_Node_Str"+ "String_Node_Str");
    }
    if (actualPortTypes.length() > 0) {
      portTypes.setToken(actualPortTypes);
    }
 else {
      portTypes.setToken(null);
    }
    if (actualParameterTypes.length() > 0) {
      parameterTypes.setToken(actualParameterTypes);
    }
 else {
      parameterTypes.setToken(null);
    }
  }
 else {
    RecordToken correctPortTypes=(RecordToken)portTypes.getToken();
    RecordToken correctParameterTypes=(RecordToken)parameterTypes.getToken();
    if (correctPortTypes != null) {
      for (Iterator actorNames=correctPortTypes.labelSet().iterator(); actorNames.hasNext(); ) {
        String actorName=(String)actorNames.next();
        RecordToken assignment=(RecordToken)correctPortTypes.get(actorName);
        for (Iterator names=assignment.labelSet().iterator(); names.hasNext(); ) {
          String name=(String)names.next();
          StringToken value=(StringToken)assignment.get(name);
          if (actualPortTypes == null) {
            throw new IllegalActionException(this,"String_Node_Str");
          }
          if (actualPortTypes.get(actorName) == null) {
            throw new IllegalActionException(this,"String_Node_Str" + actorName + "String_Node_Str"+ "String_Node_Str");
          }
          StringToken actualValue=(StringToken)((RecordToken)actualPortTypes.get(actorName)).get(name);
          if (!value.equals(actualValue)) {
            throw new IllegalActionException(this,"String_Node_Str" + ((CompositeEntity)getContainer()).getEntity(actorName).getFullName() + "String_Node_Str"+ name+ "String_Node_Str"+ value+ "String_Node_Str"+ actualValue+ "String_Node_Str");
          }
        }
      }
    }
    if (correctParameterTypes != null) {
      for (Iterator actorNames=correctParameterTypes.labelSet().iterator(); actorNames.hasNext(); ) {
        String actorName=(String)actorNames.next();
        RecordToken assignment=(RecordToken)correctParameterTypes.get(actorName);
        for (Iterator names=assignment.labelSet().iterator(); names.hasNext(); ) {
          String name=(String)names.next();
          StringToken value=(StringToken)assignment.get(name);
          StringToken actualValue=(StringToken)((RecordToken)actualParameterTypes.get(actorName)).get(name);
          if (!value.equals(actualValue)) {
            throw new IllegalActionException(this,"String_Node_Str" + ((CompositeEntity)getContainer()).getEntity(actorName).getFullName() + "String_Node_Str"+ name+ "String_Node_Str"+ value+ "String_Node_Str"+ actualValue+ "String_Node_Str");
          }
        }
      }
    }
  }
}