Program: 93167
Project: 93167
Buggy source:
/** 
 * Creates the compilation unit with the class name found in the content. If the content has a package declaration the class will be put inside of this package. For this the package must be exist. The project will not be refreshed and built after creation of this file.<br> <br> To create a file that has markers in it, use the method createFileAndParseWithMarkers() or createFileAndPackageAndParseWithMarkers().
 * @see createPackage(String)
 * @see refreshAndBuildProject()
 * @param content the content of the compilation unit. Must be java source code with or without package declaration but with a java class definition
 * @param usePackage if the package as declared in the content will be used to create the file. Means, if a package declaration exists in the content this file will be created inside of this package, otherwise the default package will be used.
 * @return the created compilation compilation unit
 * @throws CoreException
 */
public ICompilationUnit createFile(final String content,boolean usePackage) throws CoreException {
  final IProject project=javaProject.getProject();
  final String fileName=findClassName(content) + "String_Node_Str";
  StringBuilder relativeFilePath=new StringBuilder();
  if (usePackage) {
    String packageName=findPackageName(content);
    if (!packageName.equalsIgnoreCase("String_Node_Str")) {
      relativeFilePath.append(packageName.replace('.',IPath.SEPARATOR));
      relativeFilePath.append(String.valueOf(IPath.SEPARATOR));
    }
  }
  relativeFilePath.append(fileName);
  final IPath path=new Path(relativeFilePath.toString());
  final IFile file=project.getFile(path);
  if (file.exists()) {
    file.delete(true,NULL_PROGRESS_MONITOR);
  }
  final ByteArrayInputStream is=new ByteArrayInputStream(content.getBytes());
  file.create(is,true,NULL_PROGRESS_MONITOR);
  final ICompilationUnit cu=(ICompilationUnit)javaProject.findElement(path);
  return cu;
}

Fixed version (ground truth):
/** 
 * Creates the compilation unit with the class name found in the content. If the content has a package declaration the class will be put inside of this package. For this the package must be exist. The project will not be refreshed and built after creation of this file.<br> <br> To create a file that has markers in it, use the method createFileAndParseWithMarkers() or createFileAndPackageAndParseWithMarkers().
 * @see createPackage(String)
 * @see refreshAndBuildProject()
 * @param content the content of the compilation unit. Must be java source code with or without package declaration but with a java class definition
 * @param usePackage if the package as declared in the content will be used to create the file. Means, if a package declaration exists in the content this file will be created inside of this package, otherwise the default package will be used.
 * @return the created compilation compilation unit
 * @throws CoreException
 */
public ICompilationUnit createFile(final String content,boolean usePackage) throws CoreException {
  final IProject project=javaProject.getProject();
  final String fileName=findClassName(content) + "String_Node_Str";
  StringBuilder relativeFilePath=new StringBuilder();
  if (usePackage) {
    String packageName=findPackageName(content);
    if (!packageName.equalsIgnoreCase("String_Node_Str")) {
      relativeFilePath.append(packageName.replace('.',IPath.SEPARATOR));
      relativeFilePath.append(String.valueOf(IPath.SEPARATOR));
    }
  }
  relativeFilePath.append(fileName);
  final IPath path=new Path(relativeFilePath.toString());
  final IFile file=project.getFile(path);
  if (file.exists()) {
    file.delete(true,NULL_PROGRESS_MONITOR);
  }
  final ByteArrayInputStream is=new ByteArrayInputStream(content.getBytes());
  file.create(is,true,NULL_PROGRESS_MONITOR);
  int attempts=0;
  while (!file.exists()) {
    try {
      Thread.sleep(10);
    }
 catch (    InterruptedException e) {
    }
    attempts++;
    if (attempts > 10) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
  final ICompilationUnit cu=(ICompilationUnit)javaProject.findElement(path);
  return cu;
}