Program: 28294
Project: 28294
Buggy source:
public File parse(File outputDirectory,String[] classPath,Class cls) throws IOException, ParserException {
  ClassProperties allProperties=Loader.loadProperties(cls,properties,true);
  ClassProperties clsProperties=Loader.loadProperties(cls,properties,false);
  LinkedList<String> clsIncludes=new LinkedList<String>();
  clsIncludes.addAll(clsProperties.get("String_Node_Str"));
  clsIncludes.addAll(clsProperties.get("String_Node_Str"));
  LinkedList<String> allIncludes=new LinkedList<String>();
  allIncludes.addAll(allProperties.get("String_Node_Str"));
  allIncludes.addAll(allProperties.get("String_Node_Str"));
  LinkedList<String> allTargets=allProperties.get("String_Node_Str");
  LinkedList<String> clsTargets=clsProperties.get("String_Node_Str");
  LinkedList<String> clsHelpers=clsProperties.get("String_Node_Str");
  String target=clsTargets.getFirst();
  LinkedList<Class> allInherited=allProperties.getInheritedClasses();
  infoMap=new InfoMap();
  for (  Class c : allInherited) {
    try {
      ((InfoMapper)c.newInstance()).map(infoMap);
    }
 catch (    ClassCastException e) {
    }
catch (    InstantiationException e) {
    }
catch (    IllegalAccessException e) {
    }
  }
  leafInfoMap=new InfoMap();
  try {
    ((InfoMapper)cls.newInstance()).map(leafInfoMap);
  }
 catch (  ClassCastException e) {
  }
catch (  InstantiationException e) {
  }
catch (  IllegalAccessException e) {
  }
  infoMap.putAll(leafInfoMap);
  String version=Generator.class.getPackage().getImplementationVersion();
  if (version == null) {
    version="String_Node_Str";
  }
  String text="String_Node_Str" + version + "String_Node_Str";
  int n=target.lastIndexOf('.');
  if (n >= 0) {
    text+="String_Node_Str" + target.substring(0,n) + "String_Node_Str";
  }
  LinkedList<Info> infoList=leafInfoMap.get(null);
  for (  Info info : infoList) {
    if (info.javaText != null && info.javaText.startsWith("String_Node_Str")) {
      text+=info.javaText + "String_Node_Str";
    }
  }
  text+="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  for (  String s : allTargets) {
    if (!target.equals(s)) {
      text+="String_Node_Str" + s + "String_Node_Str";
    }
  }
  if (allTargets.size() > 1) {
    text+="String_Node_Str";
  }
  text+="String_Node_Str" + target.substring(n + 1) + "String_Node_Str"+ (clsHelpers.size() > 0 ? clsHelpers.getFirst() : cls.getCanonicalName())+ "String_Node_Str";
  leafInfoMap.putFirst(new Info().javaText(text));
  String targetPath=target.replace('.',File.separatorChar);
  File targetFile=new File(outputDirectory,targetPath + "String_Node_Str");
  logger.info("String_Node_Str" + targetFile);
  Context context=new Context();
  String[] includePath=classPath;
  n=targetPath.lastIndexOf(File.separatorChar);
  if (n >= 0) {
    includePath=classPath.clone();
    for (int i=0; i < includePath.length; i++) {
      includePath[i]+=File.separator + targetPath.substring(0,n);
    }
  }
  LinkedList<String> paths=allProperties.get("String_Node_Str");
  String[] includePaths=paths.toArray(new String[paths.size() + includePath.length]);
  System.arraycopy(includePath,0,includePaths,paths.size(),includePath.length);
  for (  String include : allIncludes) {
    if (!clsIncludes.contains(include)) {
      parse((File)null,context,includePaths,include);
    }
  }
  parse(targetFile,context,includePaths,clsIncludes.toArray(new String[clsIncludes.size()]));
  return targetFile;
}

Fixed version (ground truth):
public File parse(File outputDirectory,String[] classPath,Class cls) throws IOException, ParserException {
  ClassProperties allProperties=Loader.loadProperties(cls,properties,true);
  ClassProperties clsProperties=Loader.loadProperties(cls,properties,false);
  LinkedList<String> clsIncludes=new LinkedList<String>();
  clsIncludes.addAll(clsProperties.get("String_Node_Str"));
  clsIncludes.addAll(clsProperties.get("String_Node_Str"));
  LinkedList<String> allIncludes=new LinkedList<String>();
  allIncludes.addAll(allProperties.get("String_Node_Str"));
  allIncludes.addAll(allProperties.get("String_Node_Str"));
  LinkedList<String> allTargets=allProperties.get("String_Node_Str");
  LinkedList<String> clsTargets=clsProperties.get("String_Node_Str");
  LinkedList<String> clsHelpers=clsProperties.get("String_Node_Str");
  String target=clsTargets.getFirst();
  LinkedList<Class> allInherited=allProperties.getInheritedClasses();
  infoMap=new InfoMap();
  for (  Class c : allInherited) {
    try {
      ((InfoMapper)c.newInstance()).map(infoMap);
    }
 catch (    ClassCastException e) {
    }
catch (    InstantiationException e) {
    }
catch (    IllegalAccessException e) {
    }
  }
  leafInfoMap=new InfoMap();
  try {
    ((InfoMapper)cls.newInstance()).map(leafInfoMap);
  }
 catch (  ClassCastException e) {
  }
catch (  InstantiationException e) {
  }
catch (  IllegalAccessException e) {
  }
  infoMap.putAll(leafInfoMap);
  String version=Generator.class.getPackage().getImplementationVersion();
  if (version == null) {
    version="String_Node_Str";
  }
  String text="String_Node_Str" + version + "String_Node_Str";
  int n=target.lastIndexOf('.');
  if (n >= 0) {
    text+="String_Node_Str" + target.substring(0,n) + "String_Node_Str";
  }
  LinkedList<Info> infoList=leafInfoMap.get(null);
  for (  Info info : infoList) {
    if (info.javaText != null && info.javaText.startsWith("String_Node_Str")) {
      text+=info.javaText + "String_Node_Str";
    }
  }
  text+="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  for (  String s : allTargets) {
    if (!target.equals(s)) {
      text+="String_Node_Str" + s + "String_Node_Str";
    }
  }
  if (allTargets.size() > 1) {
    text+="String_Node_Str";
  }
  text+="String_Node_Str" + target.substring(n + 1) + "String_Node_Str"+ (clsHelpers.size() > 0 ? clsHelpers.getFirst() : cls.getCanonicalName())+ "String_Node_Str"+ "String_Node_Str";
  String targetPath=target.replace('.',File.separatorChar);
  File targetFile=new File(outputDirectory,targetPath + "String_Node_Str");
  logger.info("String_Node_Str" + targetFile);
  Context context=new Context();
  String[] includePath=classPath;
  n=targetPath.lastIndexOf(File.separatorChar);
  if (n >= 0) {
    includePath=classPath.clone();
    for (int i=0; i < includePath.length; i++) {
      includePath[i]+=File.separator + targetPath.substring(0,n);
    }
  }
  LinkedList<String> paths=allProperties.get("String_Node_Str");
  String[] includePaths=paths.toArray(new String[paths.size() + includePath.length]);
  System.arraycopy(includePath,0,includePaths,paths.size(),includePath.length);
  DeclarationList declList=new DeclarationList();
  for (  String include : allIncludes) {
    if (!clsIncludes.contains(include)) {
      parse(context,declList,includePaths,include);
    }
  }
  declList=new DeclarationList(declList);
  containers(context,declList);
  for (  String include : clsIncludes) {
    parse(context,declList,includePaths,include);
  }
  final String newline=lineSeparator != null ? lineSeparator : "String_Node_Str";
  Writer out=new FileWriter(targetFile){
    @Override public Writer append(    CharSequence text) throws IOException {
      return super.append(((String)text).replace("String_Node_Str",newline).replace("String_Node_Str","String_Node_Str"));
    }
  }
;
  out.append(text);
  for (  Info info : infoList) {
    if (info.javaText != null && !info.javaText.startsWith("String_Node_Str")) {
      out.append(info.javaText + "String_Node_Str");
    }
  }
  for (  Declaration d : declList) {
    out.append(d.text);
  }
  out.append("String_Node_Str").close();
  return targetFile;
}