Program: 115310
Project: 115310
Buggy source:
/** 
 * process the page from whence you came, i.e. extract a dataset
 * @param id, the id of the extract properties bean, gained from Core Resources
 * @param datasetId, the id of the dataset, found through DatasetDAO
 * @param request, http request
 * @return model map, but more importantly, creates a quartz job which runs right away and generates all output there
 */
@RequestMapping(method=RequestMethod.GET) public ModelMap processSubmit(@RequestParam("String_Node_Str") String id,@RequestParam("String_Node_Str") String datasetId,HttpServletRequest request){
  ModelMap map=new ModelMap();
  System.out.println("String_Node_Str" + id + "String_Node_Str"+ datasetId);
  datasetDao=new DatasetDAO(dataSource);
  UserAccountBean userBean=(UserAccountBean)request.getSession().getAttribute("String_Node_Str");
  ExtractPropertyBean epBean=CoreResources.findExtractPropertyBeanById(new Integer(id).intValue());
  DatasetBean dsBean=(DatasetBean)datasetDao.findByPK(new Integer(datasetId).intValue());
  XsltTriggerService xsltService=new XsltTriggerService();
  String generalFileDir=SQLInitServlet.getField("String_Node_Str");
  String pattern="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  SimpleDateFormat sdfDir=new SimpleDateFormat(pattern);
  generalFileDir=generalFileDir + "String_Node_Str" + File.separator+ dsBean.getId()+ File.separator+ sdfDir.format(new java.util.Date());
  dsBean.setName(dsBean.getName().replaceAll("String_Node_Str","String_Node_Str"));
  System.out.println("String_Node_Str" + generalFileDir);
  String xsltPath=SQLInitServlet.getField("String_Node_Str") + "String_Node_Str" + File.separator+ epBean.getFileName();
  String endFilePath=epBean.getFileLocation();
  if (endFilePath.contains("String_Node_Str"))   endFilePath=endFilePath.replace("String_Node_Str",SQLInitServlet.getField("String_Node_Str") + File.separator);
  if (endFilePath.contains("String_Node_Str"))   endFilePath=endFilePath.replace("String_Node_Str",sdfDir.format(new java.util.Date()));
  System.out.println("String_Node_Str" + xsltPath);
  SimpleTrigger simpleTrigger=xsltService.generateXsltTrigger(xsltPath,generalFileDir,endFilePath,resolveExportFilePath(epBean),dsBean.getId(),epBean,userBean);
  scheduler=getScheduler(request);
  JobDetailBean jobDetailBean=new JobDetailBean();
  jobDetailBean.setGroup(xsltService.TRIGGER_GROUP_NAME);
  jobDetailBean.setName(simpleTrigger.getName());
  jobDetailBean.setJobClass(org.akaza.openclinica.job.XsltStatefulJob.class);
  jobDetailBean.setJobDataMap(simpleTrigger.getJobDataMap());
  jobDetailBean.setDurability(true);
  jobDetailBean.setVolatility(false);
  try {
    Date dateStart=scheduler.scheduleJob(jobDetailBean,simpleTrigger);
    System.out.println("String_Node_Str" + dateStart.toString());
  }
 catch (  SchedulerException se) {
    se.printStackTrace();
  }
  request.setAttribute("String_Node_Str",datasetId);
  request.getSession().setAttribute("String_Node_Str",jobDetailBean.getName());
  request.getSession().setAttribute("String_Node_Str",simpleTrigger.getGroup());
  request.getSession().setAttribute("String_Node_Str",new Integer(dsBean.getId()));
  return map;
}

Fixed version (ground truth):
/** 
 * process the page from whence you came, i.e. extract a dataset
 * @param id, the id of the extract properties bean, gained from Core Resources
 * @param datasetId, the id of the dataset, found through DatasetDAO
 * @param request, http request
 * @return model map, but more importantly, creates a quartz job which runs right away and generates all output there
 */
@RequestMapping(method=RequestMethod.GET) public ModelMap processSubmit(@RequestParam("String_Node_Str") String id,@RequestParam("String_Node_Str") String datasetId,HttpServletRequest request){
  ModelMap map=new ModelMap();
  System.out.println("String_Node_Str" + id + "String_Node_Str"+ datasetId);
  datasetDao=new DatasetDAO(dataSource);
  UserAccountBean userBean=(UserAccountBean)request.getSession().getAttribute("String_Node_Str");
  ExtractPropertyBean epBean=CoreResources.findExtractPropertyBeanById(new Integer(id).intValue());
  DatasetBean dsBean=(DatasetBean)datasetDao.findByPK(new Integer(datasetId).intValue());
  XsltTriggerService xsltService=new XsltTriggerService();
  String generalFileDir=SQLInitServlet.getField("String_Node_Str");
  String pattern="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator;
  SimpleDateFormat sdfDir=new SimpleDateFormat(pattern);
  generalFileDir=generalFileDir + "String_Node_Str" + File.separator+ dsBean.getId()+ File.separator+ sdfDir.format(new java.util.Date());
  dsBean.setName(dsBean.getName().replaceAll("String_Node_Str","String_Node_Str"));
  System.out.println("String_Node_Str" + generalFileDir);
  String xsltPath=SQLInitServlet.getField("String_Node_Str") + "String_Node_Str" + File.separator+ epBean.getFileName();
  String endFilePath=epBean.getFileLocation();
  if (endFilePath.contains("String_Node_Str")) {
    endFilePath=endFilePath.replace("String_Node_Str",SQLInitServlet.getField("String_Node_Str"));
  }
  if (endFilePath.contains("String_Node_Str")) {
    endFilePath=endFilePath.replace("String_Node_Str",sdfDir.format(new java.util.Date()));
  }
  System.out.println("String_Node_Str" + xsltPath);
  SimpleTrigger simpleTrigger=xsltService.generateXsltTrigger(xsltPath,generalFileDir,endFilePath + File.separator,resolveExportFilePath(epBean),dsBean.getId(),epBean,userBean);
  scheduler=getScheduler(request);
  JobDetailBean jobDetailBean=new JobDetailBean();
  jobDetailBean.setGroup(xsltService.TRIGGER_GROUP_NAME);
  jobDetailBean.setName(simpleTrigger.getName());
  jobDetailBean.setJobClass(org.akaza.openclinica.job.XsltStatefulJob.class);
  jobDetailBean.setJobDataMap(simpleTrigger.getJobDataMap());
  jobDetailBean.setDurability(true);
  jobDetailBean.setVolatility(false);
  try {
    Date dateStart=scheduler.scheduleJob(jobDetailBean,simpleTrigger);
    System.out.println("String_Node_Str" + dateStart.toString());
  }
 catch (  SchedulerException se) {
    se.printStackTrace();
  }
  request.setAttribute("String_Node_Str",datasetId);
  request.getSession().setAttribute("String_Node_Str",jobDetailBean.getName());
  request.getSession().setAttribute("String_Node_Str",simpleTrigger.getGroup());
  request.getSession().setAttribute("String_Node_Str",new Integer(dsBean.getId()));
  return map;
}