Program: 74722
Project: 74722
Buggy source:
/** 
 * Return the replacement string of the given macro. Subclass of CodeGenerator may overriding this method to extend or support a different set of macros.
 * @param macro The given macro.
 * @param parameter The given parameter to the macro.
 * @return The replacement string of the given macro.
 * @throws IllegalActionException Thrown if the given macro orparameter is not valid.
 */
protected String _replaceMacro(String macro,String parameter) throws IllegalActionException {
  if (macro.equals("String_Node_Str")) {
    return getReference(parameter);
  }
 else   if (macro.equals("String_Node_Str")) {
    TypedIOPort port=getPort(parameter);
    if (port == null) {
      throw new IllegalActionException(parameter + "String_Node_Str");
    }
    return cType(port.getType());
  }
 else   if (macro.equals("String_Node_Str") || macro.equals("String_Node_Str")) {
    TypedIOPort port=getPort(parameter);
    if (port == null) {
      throw new IllegalActionException(parameter + "String_Node_Str");
    }
    if (macro.equals("String_Node_Str")) {
      return "String_Node_Str";
    }
    return codeGenType(port.getType());
  }
 else   if (macro.equals("String_Node_Str")) {
    return getParameterValue(parameter,_component);
  }
 else   if (macro.equals("String_Node_Str")) {
    return "String_Node_Str" + getSize(parameter);
  }
 else   if (macro.equals("String_Node_Str")) {
    return generateName(_component) + "String_Node_Str" + parameter;
  }
 else   if (macro.equals("String_Node_Str")) {
    return _component.getClassName().replace('.','_') + "String_Node_Str" + parameter;
  }
 else   if (macro.equals("String_Node_Str")) {
    return getNewInvocation(parameter);
  }
 else   if (macro.equals("String_Node_Str")) {
    return getFunctionInvocation(parameter,false);
  }
 else   if (macro.equals("String_Node_Str")) {
    return getFunctionInvocation(parameter,true);
  }
 else {
    throw new IllegalActionException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Return the replacement string of the given macro. Subclass of CodeGenerator may overriding this method to extend or support a different set of macros.
 * @param macro The given macro.
 * @param parameter The given parameter to the macro.
 * @return The replacement string of the given macro.
 * @throws IllegalActionException Thrown if the given macro orparameter is not valid.
 */
protected String _replaceMacro(String macro,String parameter) throws IllegalActionException {
  if (macro.equals("String_Node_Str")) {
    return getReference(parameter);
  }
 else   if (macro.equals("String_Node_Str")) {
    TypedIOPort port=getPort(parameter);
    if (port == null) {
      throw new IllegalActionException(parameter + "String_Node_Str");
    }
    return cType(port.getType());
  }
 else   if (macro.equals("String_Node_Str") || macro.equals("String_Node_Str")) {
    TypedIOPort port=getPort(parameter);
    if (port == null) {
      throw new IllegalActionException(parameter + "String_Node_Str");
    }
    String type="String_Node_Str";
    if (macro.equals("String_Node_Str")) {
      type="String_Node_Str";
    }
    return type + codeGenType(port.getType());
  }
 else   if (macro.equals("String_Node_Str")) {
    return getParameterValue(parameter,_component);
  }
 else   if (macro.equals("String_Node_Str")) {
    return "String_Node_Str" + getSize(parameter);
  }
 else   if (macro.equals("String_Node_Str")) {
    return generateName(_component) + "String_Node_Str" + parameter;
  }
 else   if (macro.equals("String_Node_Str")) {
    return _component.getClassName().replace('.','_') + "String_Node_Str" + parameter;
  }
 else   if (macro.equals("String_Node_Str")) {
    return getNewInvocation(parameter);
  }
 else   if (macro.equals("String_Node_Str")) {
    return getFunctionInvocation(parameter,false);
  }
 else   if (macro.equals("String_Node_Str")) {
    return getFunctionInvocation(parameter,true);
  }
 else {
    throw new IllegalActionException("String_Node_Str");
  }
}