Program: 25047
Project: 25047
Buggy source:
@Override protected final void service(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String uwsAction=null;
  JobOwner user=null;
  final String reqID=generateRequestID(req);
  req.setAttribute(UWS.REQ_ATTRIBUTE_ID,reqID);
  try {
    req.setAttribute(UWS.REQ_ATTRIBUTE_PARAMETERS,requestParser.parse(req));
  }
 catch (  UWSException ue) {
    logger.log(LogLevel.WARNING,"String_Node_Str","String_Node_Str",ue);
  }
  logger.logHttp(LogLevel.INFO,req,reqID,null,null);
  try {
    String method=req.getMethod();
    if (urlInterpreter == null)     setUrlInterpreter(new UWSUrl(req));
    UWSUrl requestUrl=new UWSUrl(this.urlInterpreter);
    requestUrl.load(req);
    user=UWSToolBox.getUser(req,userIdentifier);
    resp.setCharacterEncoding(UWSToolBox.DEFAULT_CHAR_ENCODING);
    if (method.equals("String_Node_Str")) {
      if (!requestUrl.hasJobList()) {
        uwsAction=UWSAction.HOME_PAGE;
        writeHomePage(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && !requestUrl.hasJob()) {
        uwsAction=UWSAction.LIST_JOBS;
        doListJob(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && !requestUrl.hasAttribute()) {
        uwsAction=UWSAction.JOB_SUMMARY;
        doJobSummary(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJobList() && requestUrl.hasAttribute()) {
        uwsAction=UWSAction.GET_JOB_PARAM;
        doGetJobParam(requestUrl,req,resp,user);
      }
 else       throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    }
 else     if (method.equals("String_Node_Str")) {
      if (!requestUrl.hasJobList()) {
        uwsAction=UWSAction.HOME_PAGE;
        writeHomePage(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && !requestUrl.hasJob()) {
        uwsAction=UWSAction.ADD_JOB;
        doAddJob(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && requestUrl.getAttributes().length == 1 && requestUrl.getAttributes()[0].toLowerCase().matches(UWSParameters.UWS_RW_PARAMETERS_REGEXP) && UWSToolBox.hasParameter(requestUrl.getAttributes()[0],req,false)) {
        uwsAction=UWSAction.SET_UWS_PARAMETER;
        doSetUWSParameter(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && (!requestUrl.hasAttribute() || requestUrl.getAttributes().length == 1 && requestUrl.getAttributes()[0].equalsIgnoreCase(UWSJob.PARAM_PARAMETERS))&& UWSToolBox.getNbParameters(req) > 0) {
        uwsAction=UWSAction.SET_JOB_PARAM;
        doSetJobParam(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && UWSToolBox.hasParameter(UWSJob.PARAM_ACTION,UWSJob.ACTION_DELETE,req,false)) {
        uwsAction=UWSAction.DESTROY_JOB;
        doDestroyJob(requestUrl,req,resp,user);
      }
 else       throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    }
 else     if (method.equals("String_Node_Str")) {
      if (requestUrl.hasJobList() && requestUrl.hasJob() && requestUrl.getAttributes().length >= 2 && requestUrl.getAttributes()[0].equalsIgnoreCase(UWSJob.PARAM_PARAMETERS)) {
        uwsAction=UWSAction.SET_JOB_PARAM;
        if (!UWSToolBox.hasParameter(requestUrl.getAttributes()[1],req,false))         throw new UWSException(UWSException.BAD_REQUEST,"String_Node_Str" + requestUrl.getAttributes()[1]);
        doSetJobParam(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && requestUrl.getAttributes().length == 1 && requestUrl.getAttributes()[0].toLowerCase().matches(UWSParameters.UWS_RW_PARAMETERS_REGEXP) && UWSToolBox.hasParameter(requestUrl.getAttributes()[0],req,false)) {
        uwsAction=UWSAction.SET_UWS_PARAMETER;
        doSetUWSParameter(requestUrl,req,resp,user);
      }
 else       throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    }
 else     if (method.equals("String_Node_Str")) {
      if (requestUrl.hasJobList() && requestUrl.hasJob() && req.getMethod().equalsIgnoreCase("String_Node_Str")) {
        uwsAction=UWSAction.DESTROY_JOB;
        doDestroyJob(requestUrl,req,resp,user);
      }
 else       throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    }
 else     throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    resp.flushBuffer();
    logger.logHttp(LogLevel.INFO,resp,reqID,user,"String_Node_Str" + uwsAction + "String_Node_Str",null);
  }
 catch (  IOException ioe) {
    logger.logHttp(LogLevel.INFO,resp,reqID,user,"String_Node_Str" + uwsAction + "String_Node_Str",null);
  }
catch (  UWSException ex) {
    sendError(ex,req,reqID,user,uwsAction,resp);
  }
catch (  IllegalStateException ise) {
    errorWriter.writeError(ise,resp,req,reqID,user,uwsAction);
    getLogger().logHttp(LogLevel.FATAL,resp,reqID,user,"String_Node_Str" + uwsAction + "String_Node_Str",(ise.getCause() != null) ? ise.getCause() : ise);
  }
catch (  Throwable t) {
    sendError(t,req,reqID,user,uwsAction,resp);
  }
 finally {
    UWSToolBox.deleteUploads(req);
  }
}

Fixed version (ground truth):
@Override protected final void service(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String uwsAction=null;
  JobOwner user=null;
  final String reqID=generateRequestID(req);
  req.setAttribute(UWS.REQ_ATTRIBUTE_ID,reqID);
  try {
    req.setAttribute(UWS.REQ_ATTRIBUTE_PARAMETERS,requestParser.parse(req));
  }
 catch (  UWSException ue) {
    logger.log(LogLevel.WARNING,"String_Node_Str","String_Node_Str",ue);
  }
  logger.logHttp(LogLevel.INFO,req,reqID,null,null);
  try {
    String method=req.getMethod();
    if (urlInterpreter == null)     setUrlInterpreter(new UWSUrl(req));
    UWSUrl requestUrl=new UWSUrl(this.urlInterpreter);
    requestUrl.load(req);
    user=UWSToolBox.getUser(req,userIdentifier);
    resp.setCharacterEncoding(UWSToolBox.DEFAULT_CHAR_ENCODING);
    if (method.equals("String_Node_Str")) {
      if (!requestUrl.hasJobList()) {
        uwsAction=UWSAction.HOME_PAGE;
        writeHomePage(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && !requestUrl.hasJob()) {
        uwsAction=UWSAction.LIST_JOBS;
        doListJob(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && !requestUrl.hasAttribute()) {
        uwsAction=UWSAction.JOB_SUMMARY;
        doJobSummary(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJobList() && requestUrl.hasAttribute()) {
        uwsAction=UWSAction.GET_JOB_PARAM;
        doGetJobParam(requestUrl,req,resp,user);
      }
 else       throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    }
 else     if (method.equals("String_Node_Str")) {
      if (!requestUrl.hasJobList()) {
        uwsAction=UWSAction.HOME_PAGE;
        writeHomePage(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && !requestUrl.hasJob()) {
        uwsAction=UWSAction.ADD_JOB;
        doAddJob(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && requestUrl.getAttributes().length == 1 && requestUrl.getAttributes()[0].toLowerCase().matches(UWSParameters.UWS_RW_PARAMETERS_REGEXP) && UWSToolBox.hasParameter(requestUrl.getAttributes()[0],req,false)) {
        uwsAction=UWSAction.SET_UWS_PARAMETER;
        doSetUWSParameter(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && UWSToolBox.hasParameter(UWSJob.PARAM_ACTION,UWSJob.ACTION_DELETE,req,false)) {
        uwsAction=UWSAction.DESTROY_JOB;
        doDestroyJob(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && (!requestUrl.hasAttribute() || requestUrl.getAttributes().length == 1 && requestUrl.getAttributes()[0].equalsIgnoreCase(UWSJob.PARAM_PARAMETERS))&& UWSToolBox.getNbParameters(req) > 0) {
        uwsAction=UWSAction.SET_JOB_PARAM;
        doSetJobParam(requestUrl,req,resp,user);
      }
 else       throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    }
 else     if (method.equals("String_Node_Str")) {
      if (requestUrl.hasJobList() && requestUrl.hasJob() && requestUrl.getAttributes().length >= 2 && requestUrl.getAttributes()[0].equalsIgnoreCase(UWSJob.PARAM_PARAMETERS)) {
        uwsAction=UWSAction.SET_JOB_PARAM;
        if (!UWSToolBox.hasParameter(requestUrl.getAttributes()[1],req,false))         throw new UWSException(UWSException.BAD_REQUEST,"String_Node_Str" + requestUrl.getAttributes()[1]);
        doSetJobParam(requestUrl,req,resp,user);
      }
 else       if (requestUrl.hasJobList() && requestUrl.hasJob() && requestUrl.getAttributes().length == 1 && requestUrl.getAttributes()[0].toLowerCase().matches(UWSParameters.UWS_RW_PARAMETERS_REGEXP) && UWSToolBox.hasParameter(requestUrl.getAttributes()[0],req,false)) {
        uwsAction=UWSAction.SET_UWS_PARAMETER;
        doSetUWSParameter(requestUrl,req,resp,user);
      }
 else       throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    }
 else     if (method.equals("String_Node_Str")) {
      if (requestUrl.hasJobList() && requestUrl.hasJob() && req.getMethod().equalsIgnoreCase("String_Node_Str")) {
        uwsAction=UWSAction.DESTROY_JOB;
        doDestroyJob(requestUrl,req,resp,user);
      }
 else       throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    }
 else     throw new UWSException(UWSException.NOT_IMPLEMENTED,"String_Node_Str");
    resp.flushBuffer();
    logger.logHttp(LogLevel.INFO,resp,reqID,user,"String_Node_Str" + uwsAction + "String_Node_Str",null);
  }
 catch (  IOException ioe) {
    logger.logHttp(LogLevel.INFO,resp,reqID,user,"String_Node_Str" + uwsAction + "String_Node_Str",null);
  }
catch (  UWSException ex) {
    sendError(ex,req,reqID,user,uwsAction,resp);
  }
catch (  IllegalStateException ise) {
    errorWriter.writeError(ise,resp,req,reqID,user,uwsAction);
    getLogger().logHttp(LogLevel.FATAL,resp,reqID,user,"String_Node_Str" + uwsAction + "String_Node_Str",(ise.getCause() != null) ? ise.getCause() : ise);
  }
catch (  Throwable t) {
    sendError(t,req,reqID,user,uwsAction,resp);
  }
 finally {
    UWSToolBox.deleteUploads(req);
  }
}