Program: 45381
Project: 45381
Buggy source:
/** 
 * process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
@Override public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
  String stylesheet=null;
  ServletTask servletTask=null;
  StringWriter stringWriter=new StringWriter();
  PrintWriter writer=new PrintWriter(stringWriter);
  try {
    servletTask=new ServletTask(this,SERVLET_TYPE.COCOON);
    BaseScreen screen=servletTask.doProcessInput(this,req,null);
    if (stylesheet == null)     stylesheet=req.getParameter(DBParams.TEMPLATE);
    if (stylesheet == null)     if (screen != null)     if (screen.getScreenFieldView() != null)     stylesheet=screen.getScreenFieldView().getStylesheetPath();
    if (stylesheet == null)     stylesheet=req.getParameter("String_Node_Str");
    if (stylesheet == null)     stylesheet="String_Node_Str";
    StreamSource stylesheetSource=this.getStylesheetSource(servletTask,stylesheet);
    ServletOutputStream outStream=res.getOutputStream();
    Result result=new StreamResult(outStream);
    TransformerFactory tFact=TransformerFactory.newInstance();
    URIResolver resolver=new MyURIResolver(servletTask,stylesheet);
    tFact.setURIResolver(resolver);
    Transformer transformer=tFact.newTransformer(stylesheetSource);
    transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
    servletTask.doProcessOutput(this,req,null,writer,screen);
    writer.flush();
    String string=stringWriter.toString();
    StringReader sourceFileReader=new StringReader(string);
    StreamSource source=new StreamSource(sourceFileReader);
    transformer.transform(source,result);
  }
 catch (  TransformerConfigurationException ex) {
    ex.printStackTrace();
  }
catch (  TransformerException ex) {
    ex.printStackTrace();
    servletTask.free();
  }
catch (  ServletException ex) {
  }
  super.service(req,res);
}

Fixed version (ground truth):
/** 
 * process an HTML get or post.
 * @exception ServletException From inherited class.
 * @exception IOException From inherited class.
 */
@Override public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException {
  String stylesheet=null;
  ServletTask servletTask=null;
  StringWriter stringWriter=new StringWriter();
  PrintWriter writer=new PrintWriter(stringWriter);
  try {
    servletTask=new ServletTask(this,SERVLET_TYPE.COCOON);
    BaseScreen screen=servletTask.doProcessInput(this,req,null);
    if (stylesheet == null)     stylesheet=req.getParameter(DBParams.TEMPLATE);
    if (stylesheet == null)     if (screen != null)     if (screen.getScreenFieldView() != null)     stylesheet=screen.getScreenFieldView().getStylesheetPath();
    if (stylesheet == null)     stylesheet=req.getParameter("String_Node_Str");
    if (stylesheet == null)     stylesheet="String_Node_Str";
    StreamSource stylesheetSource=this.getStylesheetSource(servletTask,stylesheet);
    ServletOutputStream outStream=res.getOutputStream();
    Result result=new StreamResult(outStream);
    TransformerFactory tFact=TransformerFactory.newInstance();
    URIResolver resolver=new MyURIResolver(servletTask,stylesheet);
    tFact.setURIResolver(resolver);
    Transformer transformer=tFact.newTransformer(stylesheetSource);
    transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
    servletTask.doProcessOutput(this,req,null,writer,screen);
    writer.flush();
    String string=stringWriter.toString();
    StringReader sourceFileReader=new StringReader(string);
    StreamSource source=new StreamSource(sourceFileReader);
    transformer.transform(source,result);
  }
 catch (  TransformerConfigurationException ex) {
    ex.printStackTrace();
  }
catch (  TransformerException ex) {
    ex.printStackTrace();
    servletTask.free();
  }
catch (  ServletException ex) {
  }
}