Program: 76177
Project: 76177
Buggy source:
protected void _generateNodeFile(String typeName,String parentTypeName,boolean isConcrete,boolean isSingleton,boolean isInterface,LinkedList methodList,LinkedList implList) throws IOException {
  File fdest=new File(typeName + "String_Node_Str");
  if (!fdest.createNewFile()) {
    fdest.delete();
    fdest=new File(typeName + "String_Node_Str");
    fdest.createNewFile();
  }
  FileWriter fw=new FileWriter(fdest);
  StringBuffer sb=new StringBuffer();
  sb.append(_nodeHeader);
  sb.append("String_Node_Str");
  boolean concreteClass=isConcrete && !isInterface;
  if (!isConcrete && !isInterface) {
    sb.append("String_Node_Str");
  }
 else   if (isSingleton) {
    sb.append("String_Node_Str");
  }
  sb.append(isInterface ? "String_Node_Str" : "String_Node_Str");
  sb.append(typeName);
  if (!parentTypeName.equals("String_Node_Str")) {
    sb.append("String_Node_Str");
    sb.append(parentTypeName);
  }
  Iterator implItr=implList.listIterator();
  if (implItr.hasNext()) {
    sb.append("String_Node_Str");
    do {
      String interfaceName=(String)implItr.next();
      sb.append(interfaceName);
      if (implItr.hasNext()) {
        sb.append("String_Node_Str");
      }
    }
 while (implItr.hasNext());
  }
  sb.append("String_Node_Str");
  String idString=null;
  if (concreteClass) {
    idString=typeName.toUpperCase() + "String_Node_Str";
    methodList.add(new ClassField("String_Node_Str",idString,"String_Node_Str",Integer.toString(_classCount)));
    _classCount++;
  }
  Iterator methodItr=methodList.listIterator();
  while (methodItr.hasNext()) {
    Object o=methodItr.next();
    if (o instanceof MethodSignature) {
      sb.append(o.toString());
      sb.append('\n');
    }
  }
  methodItr=methodList.listIterator();
  while (methodItr.hasNext()) {
    Object o=methodItr.next();
    if (o instanceof ClassField) {
      sb.append(o.toString());
      sb.append('\n');
    }
  }
  if (concreteClass) {
    sb.append("String_Node_Str");
    sb.append(idString);
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  fw.write(sb.toString());
  fw.close();
}

Fixed version (ground truth):
protected void _generateNodeFile(String typeName,String parentTypeName,boolean isConcrete,boolean isSingleton,boolean isInterface,LinkedList methodList,LinkedList implList) throws IOException {
  File fdest=new File(typeName + "String_Node_Str");
  if (!fdest.createNewFile()) {
    fdest.delete();
    fdest=new File(typeName + "String_Node_Str");
    fdest.createNewFile();
  }
  FileWriter fw=new FileWriter(fdest);
  StringBuffer sb=new StringBuffer();
  sb.append(_nodeHeader);
  sb.append("String_Node_Str");
  boolean concreteClass=isConcrete && !isInterface;
  if (!isConcrete && !isInterface) {
    sb.append("String_Node_Str");
  }
 else   if (isSingleton) {
    sb.append("String_Node_Str");
  }
  sb.append(isInterface ? "String_Node_Str" : "String_Node_Str");
  sb.append(typeName);
  if (!parentTypeName.equals("String_Node_Str")) {
    sb.append("String_Node_Str");
    sb.append(parentTypeName);
  }
  Iterator implItr=implList.listIterator();
  if (implItr.hasNext()) {
    sb.append("String_Node_Str");
    do {
      String interfaceName=(String)implItr.next();
      sb.append(interfaceName);
      if (implItr.hasNext()) {
        sb.append("String_Node_Str");
      }
    }
 while (implItr.hasNext());
  }
  sb.append("String_Node_Str");
  if (concreteClass) {
    String idString=typeName.toUpperCase() + "String_Node_Str";
    methodList.add(new ClassField("String_Node_Str",idString,"String_Node_Str",Integer.toString(_classCount)));
    methodList.add(new MethodSignature("String_Node_Str","String_Node_Str","String_Node_Str",new LinkedList(),new LinkedList(),"String_Node_Str" + idString + "String_Node_Str"));
    _classCount++;
  }
  if (isSingleton) {
    ClassField cf=new ClassField(typeName,"String_Node_Str","String_Node_Str","String_Node_Str" + typeName + "String_Node_Str");
    methodList.addLast(cf);
    MethodSignature ms=new MethodSignature(typeName);
    methodList.addLast(ms);
    methodList.add(new MethodSignature("String_Node_Str","String_Node_Str","String_Node_Str",new LinkedList(),new LinkedList(),"String_Node_Str"));
  }
  Iterator methodItr=methodList.listIterator();
  while (methodItr.hasNext()) {
    Object o=methodItr.next();
    if (o instanceof MethodSignature) {
      sb.append(o.toString() + "String_Node_Str");
    }
  }
  methodItr=methodList.listIterator();
  while (methodItr.hasNext()) {
    Object o=methodItr.next();
    if (o instanceof ClassField) {
      sb.append(o.toString() + "String_Node_Str");
    }
  }
  sb.append("String_Node_Str");
  fw.write(sb.toString());
  fw.close();
}