Program: 73379
Project: 73379
Buggy source:
/** 
 * Generate the assembly file associated for this PtidyOS program. Here we return an empty string, but the target specific adapter should overwrite it.
 * @return The generated assembly file code.
 * @exception IllegalActionException
 */
public StringBuffer generateAsseblyFile() throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  if (((CompositeActor)getComponent().getContainer()).getExecutiveDirector() instanceof ptolemy.domains.ptides.kernel.PtidesBasicDirector) {
    return code;
  }
  Map devices=new HashMap<Actor,String>();
  for (  Actor actor : (List<Actor>)((TypedCompositeActor)getComponent().getContainer()).deepEntityList()) {
    if (actor instanceof LuminarySensorHandler) {
      devices.put(actor,new String("String_Node_Str" + NamedProgramCodeGeneratorAdapter.generateName((NamedObj)actor)));
    }
  }
  List args=new LinkedList();
  StringBuffer externs=new StringBuffer();
  for (  Actor actor : (Set<Actor>)devices.keySet()) {
    externs.append("String_Node_Str" + devices.get(actor) + _eol);
  }
  args.add(externs.toString());
  int configurationSize=LuminarySensorHandler.numberOfSupportedInputDeviceConfigurations;
  String[] GPHandlers=new String[configurationSize];
  boolean foundConfig=false;
  for (  LuminarySensorHandler actor : (Set<LuminarySensorHandler>)devices.keySet()) {
    for (int i=0; i < actor.supportedConfigurations().size(); i++) {
      if (actor.configuration().compareTo(actor.supportedConfigurations().get(i)) == 0) {
        GPHandlers[i + Integer.parseInt(actor.startingConfiguration())]=(String)devices.get(actor);
        foundConfig=true;
        break;
      }
    }
    if (foundConfig == false) {
      throw new IllegalActionException(actor,"String_Node_Str" + "String_Node_Str");
    }
  }
  for (int i=0; i < configurationSize; i++) {
    if (GPHandlers[i] == null) {
      args.add("String_Node_Str");
    }
 else {
      args.add(GPHandlers[i]);
    }
  }
  code.append(_templateParser.getCodeStream().getCodeBlock("String_Node_Str",args));
  return code;
}

Fixed version (ground truth):
/** 
 * Generate the assembly file associated for this PtidyOS program. Here we return an empty string, but the target specific adapter should overwrite it.
 * @return The generated assembly file code.
 * @exception IllegalActionException
 */
public StringBuffer generateAsseblyFile() throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  if (((CompositeActor)getComponent().getContainer()).getExecutiveDirector() instanceof ptolemy.domains.ptides.kernel.PtidesBasicDirector) {
    return code;
  }
  Map<LuminarySensorHandler,String> devices=new HashMap<LuminarySensorHandler,String>();
  for (  Actor actor : (List<Actor>)((TypedCompositeActor)getComponent().getContainer()).deepEntityList()) {
    if (actor instanceof LuminarySensorHandler) {
      devices.put((LuminarySensorHandler)actor,"String_Node_Str" + NamedProgramCodeGeneratorAdapter.generateName((NamedObj)actor));
    }
  }
  List args=new LinkedList();
  StringBuffer externs=new StringBuffer();
  for (  LuminarySensorHandler actor : (Set<LuminarySensorHandler>)devices.keySet()) {
    externs.append("String_Node_Str" + devices.get(actor) + _eol);
  }
  args.add(externs.toString());
  int configurationSize=LuminarySensorHandler.numberOfSupportedInputDeviceConfigurations;
  String[] GPHandlers=new String[configurationSize];
  boolean foundConfig=false;
  for (  Map.Entry<LuminarySensorHandler,String> entry : devices.entrySet()) {
    LuminarySensorHandler actor=entry.getKey();
    String actorName=entry.getValue();
    for (int i=0; i < actor.supportedConfigurations().size(); i++) {
      if (actor.configuration().compareTo(actor.supportedConfigurations().get(i)) == 0) {
        GPHandlers[i + Integer.parseInt(actor.startingConfiguration())]=actorName;
        foundConfig=true;
        break;
      }
    }
    if (foundConfig == false) {
      throw new IllegalActionException(actor,"String_Node_Str" + "String_Node_Str");
    }
  }
  for (int i=0; i < configurationSize; i++) {
    if (GPHandlers[i] == null) {
      args.add("String_Node_Str");
    }
 else {
      args.add(GPHandlers[i]);
    }
  }
  code.append(_templateParser.getCodeStream().getCodeBlock("String_Node_Str",args));
  return code;
}