Program: 75666
Project: 75666
Buggy source:
/** 
 * Generate code for a C header file that implements declarations associated with a class. Code for two struct-based type definitions is generated here. One type corresponds to the class itself (class variables, function pointers to methods, etc.), and the other type is for instances of the class.
 * @param source The class.
 * @return Header code for the class.
 */
public String generate(SootClass source){
  StringBuffer bodyCode=new StringBuffer();
  StringBuffer headerCode=new StringBuffer();
  StringBuffer footerCode=new StringBuffer();
  Iterator membersIter;
  String className=source.getName();
  String typeName=CNames.instanceNameOf(source);
  headerCode.append("String_Node_Str" + typeName + "String_Node_Str");
  headerCode.append("String_Node_Str" + typeName + "String_Node_Str");
  footerCode.append("String_Node_Str");
  headerCode.append("String_Node_Str");
  if (!_context.getSingleClassMode()) {
    headerCode.append("String_Node_Str");
  }
 else {
    headerCode.append("String_Node_Str");
  }
  bodyCode.append(_comment("String_Node_Str" + className));
  bodyCode.append("String_Node_Str" + CNames.classNameOf(source) + "String_Node_Str");
  bodyCode.append(_indent(1));
  if (source.hasSuperclass() && !_context.getSingleClassMode()) {
    bodyCode.append(_comment("String_Node_Str"));
    bodyCode.append(_indent(1));
    bodyCode.append(CNames.classNameOf(source.getSuperclass()));
    bodyCode.append("String_Node_Str");
  }
 else {
    bodyCode.append(_comment("String_Node_Str" + "String_Node_Str"));
    bodyCode.append(_indent(1));
    bodyCode.append("String_Node_Str");
  }
  bodyCode.append(CNames.superclassPointerName() + "String_Node_Str");
  bodyCode.append(_indent(1) + _comment("String_Node_Str"));
  if (_context.getSingleClassMode()) {
    bodyCode.append(_indent(1) + _openComment);
  }
  bodyCode.append(_indent(1) + CNames.classNameOf(Scene.v().getSootClass("String_Node_Str")) + "String_Node_Str");
  if (_context.getSingleClassMode()) {
    bodyCode.append(_indent(1) + _closeComment);
  }
  bodyCode.append("String_Node_Str");
  if (_context.getSingleClassMode()) {
    _context.setDisableImports();
  }
  String inheritedMethods=_generateMethodPointers(MethodListGenerator.getInheritedMethods(source),"String_Node_Str");
  _context.clearDisableImports();
  String introducedMethods=_generateMethodPointers(MethodListGenerator.getNewMethods(source),"String_Node_Str") + _generateMethodPointers(MethodListGenerator.getConstructors(source),"String_Node_Str") + _generateMethodPointers(MethodListGenerator.getPrivateMethods(source),"String_Node_Str");
  if (((_context.getSingleClassMode()) || inheritedMethods.equals("String_Node_Str")) && introducedMethods.equals("String_Node_Str")) {
    bodyCode.append(_comment("String_Node_Str"));
  }
 else {
    bodyCode.append(_indent(1) + "String_Node_Str");
    bodyCode.append(inheritedMethods + introducedMethods);
    bodyCode.append("String_Node_Str" + _indent(1) + "String_Node_Str");
  }
  String staticFields=_generateStaticFields(source);
  if (!staticFields.equals("String_Node_Str")) {
    bodyCode.append("String_Node_Str" + _indent(1) + "String_Node_Str");
    bodyCode.append(staticFields);
    bodyCode.append("String_Node_Str" + _indent(1) + "String_Node_Str");
  }
  bodyCode.append("String_Node_Str");
  bodyCode.append(_comment("String_Node_Str" + className));
  bodyCode.append("String_Node_Str" + typeName + "String_Node_Str");
  bodyCode.append("String_Node_Str" + _indent(1) + CNames.classNameOf(source)+ "String_Node_Str");
  Iterator superClasses=_getSuperClasses(source).iterator();
  while (superClasses.hasNext()) {
    SootClass superClass=(SootClass)superClasses.next();
    bodyCode.append(_generateInheritedFields(source,superClass));
  }
  bodyCode.append(_generateFields(source));
  bodyCode.append("String_Node_Str");
  Iterator methods=source.getMethods().iterator();
  while (methods.hasNext()) {
    SootMethod method=(SootMethod)(methods.next());
    if (!method.isPrivate()) {
      bodyCode.append("String_Node_Str" + _comment(method.getSubSignature()));
      bodyCode.append("String_Node_Str" + _generateMethodHeader(method) + "String_Node_Str");
    }
  }
  bodyCode.append("String_Node_Str" + _comment("String_Node_Str"));
  bodyCode.append("String_Node_Str" + CNames.classNameOf(source) + "String_Node_Str"+ CNames.classStructureNameOf(source)+ "String_Node_Str");
  bodyCode.append("String_Node_Str" + _comment("String_Node_Str"));
  bodyCode.append("String_Node_Str" + CNames.initializerNameOf(source) + "String_Node_Str"+ CNames.classNameOf(source)+ "String_Node_Str");
  _removeRequiredType(source);
  if (source.hasSuperclass()) {
    _updateRequiredTypes(source.getSuperclass().getType());
  }
  headerCode.append("String_Node_Str" + className.replace('.','/') + InterfaceFileGenerator.interfaceFileNameSuffix()+ "String_Node_Str");
  headerCode.append(_generateIncludeDirectives());
  headerCode.append("String_Node_Str" + _generateArrayInstanceDeclarations());
  headerCode.append("String_Node_Str");
  return (headerCode.append(bodyCode.append(footerCode))).toString();
}

Fixed version (ground truth):
/** 
 * Generate code for a C header file that implements declarations associated with a class. Code for two struct-based type definitions is generated here. One type corresponds to the class itself (class variables, function pointers to methods, etc.), and the other type is for instances of the class.
 * @param source The class.
 * @return Header code for the class.
 */
public String generate(SootClass source){
  StringBuffer bodyCode=new StringBuffer();
  StringBuffer headerCode=new StringBuffer();
  StringBuffer footerCode=new StringBuffer();
  Iterator membersIter;
  String className=source.getName();
  String typeName=CNames.instanceNameOf(source);
  headerCode.append("String_Node_Str" + "String_Node_Str");
  headerCode.append("String_Node_Str" + typeName + "String_Node_Str");
  headerCode.append("String_Node_Str" + typeName + "String_Node_Str");
  footerCode.append("String_Node_Str");
  headerCode.append("String_Node_Str");
  if (!_context.getSingleClassMode()) {
    headerCode.append("String_Node_Str");
  }
 else {
    headerCode.append("String_Node_Str");
  }
  bodyCode.append(_comment("String_Node_Str" + className));
  bodyCode.append("String_Node_Str" + CNames.classNameOf(source) + "String_Node_Str");
  bodyCode.append(_indent(1));
  if (source.hasSuperclass() && !_context.getSingleClassMode()) {
    bodyCode.append(_comment("String_Node_Str"));
    bodyCode.append(_indent(1));
    bodyCode.append(CNames.classNameOf(source.getSuperclass()));
    bodyCode.append("String_Node_Str");
  }
 else {
    bodyCode.append(_comment("String_Node_Str" + "String_Node_Str"));
    bodyCode.append(_indent(1));
    bodyCode.append("String_Node_Str");
  }
  bodyCode.append(CNames.superclassPointerName() + "String_Node_Str");
  bodyCode.append(_indent(1) + _comment("String_Node_Str"));
  if (_context.getSingleClassMode()) {
    bodyCode.append(_indent(1) + _openComment);
  }
  bodyCode.append(_indent(1) + CNames.classNameOf(Scene.v().getSootClass("String_Node_Str")) + "String_Node_Str");
  if (_context.getSingleClassMode()) {
    bodyCode.append(_indent(1) + _closeComment);
  }
  bodyCode.append("String_Node_Str");
  if (_context.getSingleClassMode()) {
    _context.setDisableImports();
  }
  String inheritedMethods=_generateMethodPointers(MethodListGenerator.getInheritedMethods(source),"String_Node_Str");
  _context.clearDisableImports();
  String introducedMethods=_generateMethodPointers(MethodListGenerator.getNewMethods(source),"String_Node_Str") + _generateMethodPointers(MethodListGenerator.getConstructors(source),"String_Node_Str") + _generateMethodPointers(MethodListGenerator.getPrivateMethods(source),"String_Node_Str");
  if (((_context.getSingleClassMode()) || inheritedMethods.equals("String_Node_Str")) && introducedMethods.equals("String_Node_Str")) {
    bodyCode.append(_comment("String_Node_Str"));
  }
 else {
    bodyCode.append(_indent(1) + "String_Node_Str");
    bodyCode.append(inheritedMethods + introducedMethods);
    bodyCode.append("String_Node_Str" + _indent(1) + "String_Node_Str");
  }
  String staticFields=_generateStaticFields(source);
  if (!staticFields.equals("String_Node_Str")) {
    bodyCode.append("String_Node_Str" + _indent(1) + "String_Node_Str");
    bodyCode.append(staticFields);
    bodyCode.append("String_Node_Str" + _indent(1) + "String_Node_Str");
  }
  bodyCode.append("String_Node_Str");
  bodyCode.append(_comment("String_Node_Str" + className));
  bodyCode.append("String_Node_Str" + typeName + "String_Node_Str");
  bodyCode.append("String_Node_Str" + _indent(1) + CNames.classNameOf(source)+ "String_Node_Str");
  Iterator superClasses=_getSuperClasses(source).iterator();
  while (superClasses.hasNext()) {
    SootClass superClass=(SootClass)superClasses.next();
    bodyCode.append(_generateInheritedFields(source,superClass));
  }
  bodyCode.append(_generateFields(source));
  bodyCode.append("String_Node_Str");
  Iterator methods=source.getMethods().iterator();
  while (methods.hasNext()) {
    SootMethod method=(SootMethod)(methods.next());
    if (!method.isPrivate()) {
      bodyCode.append("String_Node_Str" + _comment(method.getSubSignature()));
      bodyCode.append("String_Node_Str" + _generateMethodHeader(method) + "String_Node_Str");
    }
  }
  bodyCode.append("String_Node_Str" + _comment("String_Node_Str"));
  bodyCode.append("String_Node_Str" + CNames.classNameOf(source) + "String_Node_Str"+ CNames.classStructureNameOf(source)+ "String_Node_Str");
  bodyCode.append("String_Node_Str" + _comment("String_Node_Str"));
  bodyCode.append("String_Node_Str" + CNames.initializerNameOf(source) + "String_Node_Str"+ CNames.classNameOf(source)+ "String_Node_Str");
  _removeRequiredType(source);
  if (source.hasSuperclass()) {
    _updateRequiredTypes(source.getSuperclass().getType());
  }
  headerCode.append("String_Node_Str" + className.replace('.','/') + InterfaceFileGenerator.interfaceFileNameSuffix()+ "String_Node_Str");
  headerCode.append(_generateIncludeDirectives());
  headerCode.append("String_Node_Str" + _generateArrayInstanceDeclarations());
  headerCode.append("String_Node_Str");
  return (headerCode.append(bodyCode.append(footerCode))).toString();
}