Program: 75116
Project: 75116
Buggy source:
/** 
 * Transform the Java source in the file given by its name with given class paths, and output the result to the writer. <p> If a output directory is set with the <tt>-output</tt> command-line argument, the output is written to a Java source file with that directory as the root directory. The given writer is not used in that case.
 * @param fileName The Java file name.
 * @param writer The writer where output is written.
 * @param classPaths The class paths.
 * @exception IOException If IO exception occurs when reading fromthe Java file or riting to the output.
 * @exception ASTMalformedException If the Java source is illegal.
 * @see #transform(String,Writer)
 */
public static void transform(String fileName,Writer writer,String[] classPaths) throws IOException, ASTMalformedException {
  boolean needClose=false;
  Transformer transform=new Transformer(fileName,classPaths);
  transform._startTransform();
  if (_rootPath != null) {
    String packageName=transform._ast.getPackage().getName().toString();
    File file=new File(fileName);
    String outputFileName=file.getName();
    SourceOutputStream outputStream=SourceOutputStream.getStream(_rootPath,packageName,outputFileName);
    writer=new OutputStreamWriter(outputStream);
    needClose=true;
  }
  transform._outputSource(writer);
  if (needClose)   writer.close();
}

Fixed version (ground truth):
/** 
 * Transform the Java source in the file given by its name with given class paths, and output the result to the writer. <p> If a output directory is set with the <tt>-output</tt> command-line argument, the output is written to a Java source file with that directory as the root directory. The given writer is not used in that case.
 * @param fileName The Java file name.
 * @param writer The writer where output is written.
 * @param classPaths The class paths.
 * @exception IOException If IO exception occurs when reading fromthe Java file or riting to the output.
 * @exception ASTMalformedException If the Java source is illegal.
 * @see #transform(String,Writer)
 */
public static void transform(String fileName,Writer writer,String[] classPaths) throws IOException, ASTMalformedException {
  boolean needClose=false;
  Transformer transform=new Transformer(fileName,classPaths);
  transform._startTransform();
  if (_rootPath != null) {
    String packageName=transform._ast.getPackage().getName().toString();
    File file=new File(fileName);
    String outputFileName=file.getName();
    SourceOutputStream outputStream=SourceOutputStream.getStream(_rootPath,packageName,outputFileName,_overwrite);
    writer=new OutputStreamWriter(outputStream);
    needClose=true;
  }
  transform._outputSource(writer);
  if (needClose)   writer.close();
  if (_configName != null) {
    File file=new File(fileName);
    String simpleName=file.getName();
    if (simpleName.toUpperCase().endsWith("String_Node_Str")) {
      String baseName=simpleName.substring(0,simpleName.length() - 5);
      CompilationUnit root=(CompilationUnit)transform._ast.getRoot();
      String className;
      if (root.getPackage() != null)       className=root.getPackage().getName().toString() + "String_Node_Str" + baseName;
 else       className=baseName;
      if (_prefix != null && _prefix.length() > 0)       className=className.substring(_prefix.length() + 1);
      _classes.add(className);
    }
  }
}