Program: 24702
Project: 24702
Buggy source:
/** 
 * Loads the source document, optionally performs a text search on it, and then runs the document formatter to produce the final HTML result page.
 * @param docInfo    Document information (stylesheet, source, etc.)
 * @param req        The original HTTP request
 * @param res        Where to send the HTML response
 * @exception TransformerException  If there's an error in the stylesheet.
 * @exception IOException           If stylesheet or source can't be read.
 */
private void apply(DocInfo docInfo,HttpServletRequest req,HttpServletResponse res) throws Exception {
  boolean dump=false;
  Templates pss=stylesheetCache.find(docInfo.style);
  res.setContentType(calcMimeType(pss));
  Transformer transformer=pss.newTransformer();
  stuffAttribs(transformer,req);
  stuffAttribs(transformer,config.attribs);
  readBranding(docInfo.brand,req,transformer);
  Source sourceDoc=getSourceDoc(docInfo,transformer);
  String raw=req.getParameter("String_Node_Str");
  if ("String_Node_Str".equals(raw) || "String_Node_Str".equals(raw) || "String_Node_Str".equals(raw)) {
    res.setContentType("String_Node_Str");
    transformer=IndexUtil.createTransformer();
    Properties props=transformer.getOutputProperties();
    props.put("String_Node_Str","String_Node_Str");
    props.put("String_Node_Str","String_Node_Str");
    transformer.setOutputProperties(props);
  }
  if (dump && sourceDoc instanceof PersistentTree)   ((PersistentTree)sourceDoc).setAllPermanent(true);
  if (!(transformer.getErrorListener() instanceof XTFSaxonErrorListener))   transformer.setErrorListener(new XTFSaxonErrorListener());
  ((Controller)transformer).getExecutable().setStripsWhitespace(false);
  try {
    transformer.transform(sourceDoc,createFilteredReceiver(transformer,req,res));
  }
 catch (  Exception e) {
    if (config.stylesheetProfiling) {
      Trace.info("String_Node_Str" + getRequestURL(req));
      Trace.tab();
      ((PersistentTree)sourceDoc).printProfile();
      Trace.untab();
      Trace.info("String_Node_Str");
    }
    if (dump && sourceDoc instanceof SearchTree) {
      ((SearchTree)sourceDoc).pruneUnused();
      File file=new File("String_Node_Str");
      Trace.info("String_Node_Str" + file.getAbsolutePath());
      PrintWriter outWriter=new PrintWriter(new OutputStreamWriter(new FileOutputStream(file),"String_Node_Str"));
      outWriter.println(XMLWriter.toString(sourceDoc));
      outWriter.close();
    }
    throw e;
  }
  if (config.stylesheetProfiling) {
    Trace.info("String_Node_Str" + getRequestURL(req));
    Trace.tab();
    ((PersistentTree)sourceDoc).printProfile();
    Trace.untab();
    Trace.info("String_Node_Str");
  }
  if (dump && sourceDoc instanceof SearchTree) {
    ((SearchTree)sourceDoc).pruneUnused();
    File file=new File("String_Node_Str");
    Trace.info("String_Node_Str" + file.getAbsolutePath());
    PrintWriter outWriter=new PrintWriter(new OutputStreamWriter(new FileOutputStream(file),"String_Node_Str"));
    outWriter.println(XMLWriter.toString(sourceDoc));
    outWriter.close();
  }
  if (sourceDoc instanceof PersistentTree)   ((PersistentTree)sourceDoc).close();
}

Fixed version (ground truth):
/** 
 * Loads the source document, optionally performs a text search on it, and then runs the document formatter to produce the final HTML result page.
 * @param docInfo    Document information (stylesheet, source, etc.)
 * @param req        The original HTTP request
 * @param res        Where to send the HTML response
 * @exception TransformerException  If there's an error in the stylesheet.
 * @exception IOException           If stylesheet or source can't be read.
 */
private void apply(DocInfo docInfo,HttpServletRequest req,HttpServletResponse res) throws Exception {
  boolean dump=false;
  Templates pss=stylesheetCache.find(docInfo.style);
  res.setContentType(calcMimeType(pss));
  Transformer transformer=pss.newTransformer();
  stuffAttribs(transformer,req);
  stuffAttribs(transformer,config.attribs);
  readBranding(docInfo.brand,req,transformer);
  Source sourceDoc=getSourceDoc(docInfo,transformer);
  String raw=req.getParameter("String_Node_Str");
  if ("String_Node_Str".equals(raw) || "String_Node_Str".equals(raw) || "String_Node_Str".equals(raw)) {
    res.setContentType("String_Node_Str");
    transformer=IndexUtil.createTransformer();
    Properties props=transformer.getOutputProperties();
    props.put("String_Node_Str","String_Node_Str");
    props.put("String_Node_Str","String_Node_Str");
    transformer.setOutputProperties(props);
  }
  if (dump && sourceDoc instanceof PersistentTree)   ((PersistentTree)sourceDoc).setAllPermanent(true);
  if (!(transformer.getErrorListener() instanceof XTFSaxonErrorListener))   transformer.setErrorListener(new XTFSaxonErrorListener());
  ((Controller)transformer).getExecutable().setStripsWhitespace(false);
  try {
    transformer.transform(sourceDoc,createFilteredReceiver(transformer,req,res));
  }
  finally {
    if (config.stylesheetProfiling) {
      Trace.info("String_Node_Str" + getRequestURL(req));
      Trace.tab();
      ((PersistentTree)sourceDoc).printProfile();
      Trace.untab();
      Trace.info("String_Node_Str");
    }
    if (dump && sourceDoc instanceof SearchTree) {
      ((SearchTree)sourceDoc).pruneUnused();
      File file=new File("String_Node_Str");
      Trace.info("String_Node_Str" + file.getAbsolutePath());
      PrintWriter outWriter=new PrintWriter(new OutputStreamWriter(new FileOutputStream(file),"String_Node_Str"));
      outWriter.println(XMLWriter.toString(sourceDoc));
      outWriter.close();
    }
    if (sourceDoc instanceof PersistentTree)     ((PersistentTree)sourceDoc).close();
  }
}