Program: 74072
Project: 74072
Buggy source:
/** 
 * Generate variable declarations for inputs and outputs and parameters. Append the declarations to the given string buffer.
 * @param target The ProgramCodeGeneratorAdapter for which code needs to be generated.
 * @return code The generated code.
 * @exception IllegalActionException If the adapter class for the modeldirector cannot be found.
 */
@Override protected String _generateVariableDeclaration(ProgramCodeGeneratorAdapter target) throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  ProgramCodeGenerator codeGenerator=getCodeGenerator();
  String name=ProgramCodeGeneratorAdapterStrategy.generateName(target.getComponent());
  String referencedParameterDeclaration=_generateReferencedParameterDeclaration(target);
  if (referencedParameterDeclaration.length() > 1) {
    code.append(_eol + codeGenerator.comment(name + "String_Node_Str"));
    code.append(referencedParameterDeclaration);
  }
  String inputVariableDeclaration=_generateInputVariableDeclaration(target);
  if (inputVariableDeclaration.length() > 1) {
    code.append(_eol + codeGenerator.comment(name + "String_Node_Str"));
    code.append(inputVariableDeclaration);
  }
  String outputVariableDeclaration=_generateOutputVariableDeclaration(target);
  if (outputVariableDeclaration.length() > 1) {
    code.append(_eol + codeGenerator.comment(name + "String_Node_Str"));
    code.append(outputVariableDeclaration);
  }
  String typeConvertVariableDeclaration=_generateTypeConvertVariableDeclaration();
  if (typeConvertVariableDeclaration.length() > 1) {
    code.append(_eol + codeGenerator.comment(name + "String_Node_Str"));
    code.append(typeConvertVariableDeclaration);
  }
  return processCode(code.toString());
}

Fixed version (ground truth):
/** 
 * Generate variable declarations for inputs and outputs and parameters. Append the declarations to the given string buffer.
 * @param target The ProgramCodeGeneratorAdapter for which code needs to be generated.
 * @return code The generated code.
 * @exception IllegalActionException If the adapter class for the modeldirector cannot be found.
 */
@Override protected String _generateVariableDeclaration(ProgramCodeGeneratorAdapter target) throws IllegalActionException {
  StringBuffer code=new StringBuffer();
  ProgramCodeGenerator codeGenerator=getCodeGenerator();
  String name=ProgramCodeGeneratorAdapterStrategy.generateName(target.getComponent());
  String referencedParameterDeclaration=_generateReferencedParameterDeclaration(target);
  if (referencedParameterDeclaration.length() > 1) {
    code.append(_eol + codeGenerator.comment(name + "String_Node_Str"));
    code.append(referencedParameterDeclaration);
  }
  String inputVariableDeclaration=_generateInputVariableDeclaration(target);
  if (inputVariableDeclaration.length() > 1) {
    code.append(_eol + codeGenerator.comment(name + "String_Node_Str"));
    code.append(inputVariableDeclaration);
  }
  String outputVariableDeclaration=_generateOutputVariableDeclaration(target);
  if (outputVariableDeclaration.length() > 1) {
    code.append(_eol + codeGenerator.comment(name + "String_Node_Str"));
    code.append(outputVariableDeclaration);
  }
  String typeConvertVariableDeclaration=_generateTypeConvertVariableDeclaration(target);
  if (typeConvertVariableDeclaration.length() > 1) {
    code.append(_eol + codeGenerator.comment(name + "String_Node_Str"));
    code.append(typeConvertVariableDeclaration);
  }
  return processCode(code.toString());
}