Program: 73627
Project: 73627
Buggy source:
/** 
 * Generate variable initialization for the referenced parameters.
 * @return code The generated code.
 * @exception IllegalActionException If the adapter class for the modeldirector cannot be found.
 */
@Override public String generateVariableInitialization() throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  CompositeActor container=(CompositeActor)_director.getContainer();
  GenericCodeGenerator codeGenerator=getCodeGenerator();
{
    NamedProgramCodeGeneratorAdapter adapterObject=(NamedProgramCodeGeneratorAdapter)codeGenerator.getAdapter(container);
    code.append(_generateVariableInitialization(adapterObject));
  }
  Iterator<?> actors=container.deepEntityList().iterator();
  while (actors.hasNext()) {
    Actor actor=(Actor)actors.next();
    NamedProgramCodeGeneratorAdapter adapterObject=(NamedProgramCodeGeneratorAdapter)codeGenerator.getAdapter(actor);
    code.append(_generateVariableInitialization(adapterObject));
  }
  ptolemy.actor.sched.StaticSchedulingDirector director=(ptolemy.actor.sched.StaticSchedulingDirector)getComponent();
  Schedule schedule=director.getScheduler().getSchedule();
  Iterator<?> actorsToFire=schedule.firingIterator();
  while (actorsToFire.hasNext()) {
    Firing firing=(Firing)actorsToFire.next();
    Actor actor=firing.getActor();
    if (actor instanceof ModularCodeGenTypedCompositeActor || actor instanceof ModularCompiledSDFTypedCompositeActor) {
      String className=NamedProgramCodeGeneratorAdapter.generateName((NamedObj)actor);
      String actorName=ModularCodeGenTypedCompositeActor.classToActorName(className);
      code.append(actorName + "String_Node_Str" + className+ "String_Node_Str"+ _eol);
      code.append(actorName + "String_Node_Str" + _eol);
    }
  }
  return code.toString();
}

Fixed version (ground truth):
/** 
 * Generate variable initialization for the referenced parameters.
 * @return code The generated code.
 * @exception IllegalActionException If the adapter class for the modeldirector cannot be found.
 */
@Override public String generateVariableInitialization() throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  CompositeActor container=(CompositeActor)_director.getContainer();
  GenericCodeGenerator codeGenerator=getCodeGenerator();
{
    NamedProgramCodeGeneratorAdapter adapterObject=(NamedProgramCodeGeneratorAdapter)codeGenerator.getAdapter(container);
    code.append(_generateVariableInitialization(adapterObject));
  }
  Iterator<?> actors=container.deepEntityList().iterator();
  while (actors.hasNext()) {
    Actor actor=(Actor)actors.next();
    NamedProgramCodeGeneratorAdapter adapterObject=(NamedProgramCodeGeneratorAdapter)codeGenerator.getAdapter(actor);
    code.append(_generateVariableInitialization(adapterObject));
  }
  ptolemy.actor.sched.StaticSchedulingDirector director=(ptolemy.actor.sched.StaticSchedulingDirector)getComponent();
  Schedule schedule=director.getScheduler().getSchedule();
  Iterator<?> actorsToFire=schedule.firingIterator();
  while (actorsToFire.hasNext()) {
    Firing firing=(Firing)actorsToFire.next();
    Actor actor=firing.getActor();
    if (actor instanceof ModularCodeGenTypedCompositeActor || actor instanceof ModularCompiledSDFTypedCompositeActor) {
      String className=NamedProgramCodeGeneratorAdapter.generateName((NamedObj)actor);
      String actorName=ModularCodeGenTypedCompositeActor.classToActorName(className);
      code.append(actorName + "String_Node_Str" + className+ "String_Node_Str"+ _eol);
      code.append(actorName + "String_Node_Str" + _eol);
    }
 else {
      NamedProgramCodeGeneratorAdapter adapterObject=(NamedProgramCodeGeneratorAdapter)codeGenerator.getAdapter(actor);
      code.append(adapterObject.generateVariableInitialization());
    }
  }
  return code.toString();
}