Program: 76829
Project: 76829
Buggy source:
/** 
 * Initial the parameters class. Web.xml is in UTF-8 format. No need to do encoding convertion.
 * @param context Servlet Context
 */
public synchronized static void initParameters(ServletContext context){
  if (isInitContext)   return;
  workingFolder=context.getInitParameter(INIT_PARAM_REPORT_DIR);
  documentFolder=context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER);
  if (workingFolder == null || workingFolder.trim().length() <= 0) {
    workingFolder=getRealPath(context,"String_Node_Str");
  }
  if (workingFolder != null && workingFolder.trim().endsWith(File.separator)) {
    workingFolder=workingFolder.trim().substring(0,workingFolder.trim().length() - 1);
  }
  if (documentFolder == null || documentFolder.trim().length() <= 0)   documentFolder=workingFolder;
  webAppLocale=getLocaleFromString(context.getInitParameter(INIT_PARAM_LOCALE));
  if (webAppLocale == null)   webAppLocale=Locale.getDefault();
  isDocumentFolderAccessOnly=Boolean.valueOf(context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER_ACCESS_ONLY)).booleanValue();
  String s_maxRows=context.getInitParameter(INIT_PARAM_VIEWER_MAXROWS);
  try {
    maxRows=Integer.valueOf(s_maxRows).intValue();
  }
 catch (  NumberFormatException e) {
    maxRows=-1;
  }
  birtResourceFolder=context.getInitParameter(INIT_PARAM_BIRT_RESOURCE_PATH);
  String s_overwrite=context.getInitParameter(INIT_PARAM_OVERWRITE_DOCUMENT);
  if ("String_Node_Str".equalsIgnoreCase(s_overwrite)) {
    isOverWrite=true;
  }
 else {
    isOverWrite=false;
  }
  clearDocuments();
  isInitContext=true;
}

Fixed version (ground truth):
/** 
 * Initial the parameters class. Web.xml is in UTF-8 format. No need to do encoding convertion.
 * @param context Servlet Context
 */
public synchronized static void initParameters(ServletContext context){
  if (isInitContext)   return;
  workingFolder=context.getInitParameter(INIT_PARAM_REPORT_DIR);
  documentFolder=context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER);
  if (workingFolder == null || workingFolder.trim().length() <= 0) {
    workingFolder=getRealPath(context,"String_Node_Str");
  }
  if (workingFolder != null && workingFolder.trim().endsWith(File.separator)) {
    workingFolder=workingFolder.trim().substring(0,workingFolder.trim().length() - 1);
  }
  if (documentFolder == null || documentFolder.trim().length() <= 0)   documentFolder=workingFolder;
  webAppLocale=getLocaleFromString(context.getInitParameter(INIT_PARAM_LOCALE));
  if (webAppLocale == null)   webAppLocale=Locale.getDefault();
  isDocumentFolderAccessOnly=Boolean.valueOf(context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER_ACCESS_ONLY)).booleanValue();
  String s_maxRows=context.getInitParameter(INIT_PARAM_VIEWER_MAXROWS);
  try {
    maxRows=Integer.valueOf(s_maxRows).intValue();
  }
 catch (  NumberFormatException e) {
    maxRows=-1;
  }
  birtResourceFolder=context.getInitParameter(INIT_PARAM_BIRT_RESOURCE_PATH);
  String s_overwrite=context.getInitParameter(INIT_PARAM_OVERWRITE_DOCUMENT);
  if ("String_Node_Str".equalsIgnoreCase(s_overwrite)) {
    isOverWrite=true;
  }
 else {
    isOverWrite=false;
  }
  initProps=initViewerProps(context,initProps);
  clearDocuments();
  isInitContext=true;
}