Program: 73265
Project: 73265
Buggy source:
/** 
 * Generate the main entry point.
 * @return Return the definition of the main entry point for a program. InC, this would be defining main().
 * @exception IllegalActionException Not thrown in this base class.
 */
public String generateMainEntryCode() throws IllegalActionException {
  StringBuffer mainEntryCode=new StringBuffer();
  if (_isTopLevel()) {
    mainEntryCode.append(_eol + _eol + "String_Node_Str"+ _eol+ _sanitizedModelName+ "String_Node_Str"+ _sanitizedModelName+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol);
  }
 else {
    if ((getContainer() instanceof ModularCodeGenTypedCompositeActor) && ((Actor)getContainer()).outputPortList().size() > 0) {
      mainEntryCode.append(_eol + _eol + "String_Node_Str"+ _eol);
    }
 else {
      mainEntryCode.append(_eol + _eol + "String_Node_Str"+ _eol);
    }
    boolean addComma=false;
    Iterator<?> inputPorts=((Actor)getContainer()).inputPortList().iterator();
    while (inputPorts.hasNext()) {
      TypedIOPort inputPort=(TypedIOPort)inputPorts.next();
      if (inputPort.getWidth() > 0) {
        String type=codeGenType2(inputPort.getType());
        if (!type.equals("String_Node_Str") && !isPrimitive(codeGenType(inputPort.getType()))) {
          type="String_Node_Str";
        }
        for (int i=0; i < inputPort.getWidth(); i++) {
          if (addComma) {
            mainEntryCode.append("String_Node_Str");
          }
          if (DFUtilities.getTokenConsumptionRate(inputPort) > 1) {
            mainEntryCode.append(type + "String_Node_Str" + inputPort.getName()+ "String_Node_Str"+ i);
          }
 else {
            mainEntryCode.append(type + "String_Node_Str" + inputPort.getName()+ "String_Node_Str"+ i);
          }
          addComma=true;
        }
      }
    }
    mainEntryCode.append("String_Node_Str" + _eol);
  }
  return _processCode(mainEntryCode.toString());
}

Fixed version (ground truth):
/** 
 * Generate the main entry point.
 * @return Return the definition of the main entry point for a program. InC, this would be defining main().
 * @exception IllegalActionException Not thrown in this base class.
 */
public String generateMainEntryCode() throws IllegalActionException {
  StringBuffer mainEntryCode=new StringBuffer();
  if (_isTopLevel()) {
    mainEntryCode.append(_eol + _eol + "String_Node_Str"+ _eol+ _sanitizedModelName+ "String_Node_Str"+ _sanitizedModelName+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol+ "String_Node_Str"+ _eol);
  }
 else {
    boolean addComma=false;
    if ((getContainer() instanceof ModularCodeGenTypedCompositeActor) && ((Actor)getContainer()).outputPortList().size() > 0) {
      mainEntryCode.append(_eol + _eol + "String_Node_Str"+ _eol);
      addComma=true;
    }
 else {
      mainEntryCode.append(_eol + _eol + "String_Node_Str"+ _eol);
    }
    Iterator<?> inputPorts=((Actor)getContainer()).inputPortList().iterator();
    while (inputPorts.hasNext()) {
      TypedIOPort inputPort=(TypedIOPort)inputPorts.next();
      if (inputPort.getWidth() > 0) {
        String type=codeGenType2(inputPort.getType());
        if (!type.equals("String_Node_Str") && !isPrimitive(codeGenType(inputPort.getType()))) {
          type="String_Node_Str";
        }
        for (int i=0; i < inputPort.getWidth(); i++) {
          if (addComma) {
            mainEntryCode.append("String_Node_Str");
          }
          if (DFUtilities.getTokenConsumptionRate(inputPort) > 1) {
            mainEntryCode.append(type + "String_Node_Str" + inputPort.getName()+ "String_Node_Str"+ i);
          }
 else {
            mainEntryCode.append(type + "String_Node_Str" + inputPort.getName()+ "String_Node_Str"+ i);
          }
          addComma=true;
        }
      }
    }
    mainEntryCode.append("String_Node_Str" + _eol);
  }
  return _processCode(mainEntryCode.toString());
}