Program: 115301
Project: 115301
Buggy source:
@Override public void processRequest() throws Exception {
  FormProcessor fp=new FormProcessor(request);
  HashMap<String,String> newUploadedFiles=(HashMap<String,String>)session.getAttribute("String_Node_Str");
  if (newUploadedFiles == null) {
    newUploadedFiles=new HashMap<String,String>();
  }
  String submitted=fp.getString("String_Node_Str") != null ? fp.getString("String_Node_Str") : "String_Node_Str";
  if ("String_Node_Str".equalsIgnoreCase(submitted)) {
    request.setAttribute("String_Node_Str",fp.getString("String_Node_Str"));
    request.setAttribute("String_Node_Str",fp.getString("String_Node_Str"));
    forwardPage(Page.FILE_UPLOAD);
  }
 else {
    String dir=Utils.getAttachedFilePath(currentStudy);
    if (dir == null || dir.length() <= 0) {
      request.setAttribute("String_Node_Str","String_Node_Str");
      this.forwardPage(Page.FILE_UPLOAD);
    }
 else {
      if (!new File(dir).isDirectory()) {
        new File(dir).mkdirs();
        logger.info("String_Node_Str" + dir);
      }
      request.setAttribute("String_Node_Str",dir);
      try {
        List<File> files=uploadHelper.returnFiles(request,context,dir,new OCFileRename());
        String fileName="String_Node_Str";
        for (        File temp : files) {
          if (temp == null || temp.getName() == null) {
            fileName="String_Node_Str";
          }
 else {
            fileName=temp.getName();
            logger.info("String_Node_Str" + fileName);
          }
        }
        logger.info("String_Node_Str" + fileName);
        request.setAttribute("String_Node_Str",fileName);
        request.setAttribute("String_Node_Str","String_Node_Str");
        String key="String_Node_Str";
        String inputName=(String)request.getAttribute("String_Node_Str");
        String itemId=(String)request.getAttribute("String_Node_Str");
        request.setAttribute("String_Node_Str",itemId + "String_Node_Str");
        if (inputName != null && inputName.length() > 0) {
          key=fileName;
        }
 else {
          key=itemId;
        }
        if (fileName.length() > 0) {
          newUploadedFiles.put(key,dir + File.separator + fileName);
          addPageMessage(fileName + "String_Node_Str" + respage.getString("String_Node_Str"));
        }
 else {
          request.setAttribute("String_Node_Str","String_Node_Str");
          addPageMessage(respage.getString("String_Node_Str"));
        }
        if (inputName != null && inputName.length() > 0) {
          request.setAttribute("String_Node_Str",inputName);
        }
        session.setAttribute("String_Node_Str",newUploadedFiles);
      }
 catch (      OpenClinicaSystemException e) {
        request.setAttribute("String_Node_Str","String_Node_Str");
        addPageMessage(respage.getString("String_Node_Str"));
        e.printStackTrace();
      }
      this.forwardPage(Page.FILE_UPLOAD);
    }
  }
}

Fixed version (ground truth):
@Override public void processRequest() throws Exception {
  FormProcessor fp=new FormProcessor(request);
  HashMap<String,String> newUploadedFiles=(HashMap<String,String>)session.getAttribute("String_Node_Str");
  if (newUploadedFiles == null) {
    newUploadedFiles=new HashMap<String,String>();
  }
  String submitted=fp.getString("String_Node_Str") != null ? fp.getString("String_Node_Str") : "String_Node_Str";
  if ("String_Node_Str".equalsIgnoreCase(submitted)) {
    request.setAttribute("String_Node_Str",fp.getString("String_Node_Str"));
    request.setAttribute("String_Node_Str",fp.getString("String_Node_Str"));
    forwardPage(Page.FILE_UPLOAD);
  }
 else {
    String dir=Utils.getAttachedFilePath(currentStudy);
    if (dir == null || dir.length() <= 0) {
      request.setAttribute("String_Node_Str","String_Node_Str");
      this.forwardPage(Page.FILE_UPLOAD);
    }
 else {
      if (!new File(dir).isDirectory()) {
        new File(dir).mkdirs();
        logger.info("String_Node_Str" + dir);
      }
      request.setAttribute("String_Node_Str",dir);
      try {
        List<File> files=uploadHelper.returnFiles(request,context,dir,new OCFileRename());
        String fileName="String_Node_Str";
        for (        File temp : files) {
          if (temp == null || temp.getName() == null) {
            fileName="String_Node_Str";
          }
 else {
            fileName=temp.getName();
            logger.info("String_Node_Str" + fileName);
          }
        }
        logger.info("String_Node_Str" + fileName);
        request.setAttribute("String_Node_Str",fileName);
        request.setAttribute("String_Node_Str","String_Node_Str");
        String key="String_Node_Str";
        String inputName=(String)request.getAttribute("String_Node_Str");
        String itemId=(String)request.getAttribute("String_Node_Str");
        request.setAttribute("String_Node_Str",itemId + "String_Node_Str");
        if (inputName != null && inputName.length() > 0) {
          key=fileName;
        }
 else {
          key=itemId;
        }
        if (fileName.length() > 0) {
          newUploadedFiles.put(key,dir + File.separator + fileName);
          addPageMessage(fileName + "String_Node_Str" + respage.getString("String_Node_Str"));
        }
 else {
          request.setAttribute("String_Node_Str","String_Node_Str");
          addPageMessage(respage.getString("String_Node_Str"));
        }
        if (inputName != null && inputName.length() > 0) {
          request.setAttribute("String_Node_Str",inputName);
        }
        session.setAttribute("String_Node_Str",newUploadedFiles);
      }
 catch (      OpenClinicaSystemException e) {
        request.setAttribute("String_Node_Str","String_Node_Str");
        MessageFormat mf=new MessageFormat("String_Node_Str");
        mf.applyPattern(respage.getString(e.getErrorCode()));
        Object[] arguments=e.getErrorParams();
        addPageMessage(respage.getString("String_Node_Str") + mf.format(arguments));
        e.printStackTrace();
      }
      this.forwardPage(Page.FILE_UPLOAD);
    }
  }
}