Program: 66609
Project: 66609
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;
  if ("String_Node_Str".equalsIgnoreCase(System.getProperty(IBirtConstants.SYS_PROP_BIRT_ISDESIGNER)))   isDesigner=true;
  String workingPath="String_Node_Str" + IBirtConstants.SYS_PROP_WORKING_PATH + "String_Node_Str";
  workingFolder=processWorkingFolder(context,context.getInitParameter(INIT_PARAM_WORKING_DIR));
  String initDocumentFolder=context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER);
  if (isDesigner && initDocumentFolder == null)   initDocumentFolder=workingPath + IBirtConstants.DEFAULT_DOCUMENT_FOLDER;
  String documentFolder=processRealPath(context,initDocumentFolder,IBirtConstants.DEFAULT_DOCUMENT_FOLDER,true);
  String initImageFolder=context.getInitParameter(ParameterAccessor.INIT_PARAM_IMAGE_DIR);
  if (isDesigner && initImageFolder == null)   initImageFolder=workingPath + IBirtConstants.DEFAULT_IMAGE_FOLDER;
  String imageFolder=processRealPath(context,initImageFolder,IBirtConstants.DEFAULT_IMAGE_FOLDER,true);
  String initLogFolder=context.getInitParameter(ParameterAccessor.INIT_PARAM_LOG_DIR);
  if (isDesigner && initLogFolder == null)   initLogFolder=workingPath + IBirtConstants.DEFAULT_LOGS_FOLDER;
  logFolder=processRealPath(context,initLogFolder,IBirtConstants.DEFAULT_LOGS_FOLDER,true);
  logLevel=context.getInitParameter(ParameterAccessor.INIT_PARAM_LOG_LEVEL);
  if (logLevel == null)   logLevel=IBirtConstants.DEFAULT_LOGS_LEVEL;
  String rootPath="String_Node_Str" + IBirtConstants.SYS_PROP_ROOT_PATH + "String_Node_Str";
  String initScriptlibFolder=context.getInitParameter(ParameterAccessor.INIT_PARAM_SCRIPTLIB_DIR);
  if (isDesigner && initScriptlibFolder == null)   initScriptlibFolder=rootPath + IBirtConstants.DEFAULT_SCRIPTLIB_FOLDER;
  scriptLibDir=processRealPath(context,initScriptlibFolder,IBirtConstants.DEFAULT_SCRIPTLIB_FOLDER,false);
  webAppLocale=getLocaleFromString(context.getInitParameter(INIT_PARAM_LOCALE));
  if (webAppLocale == null)   webAppLocale=Locale.getDefault();
  webAppTimeZone=getTimeZoneFromString(context.getInitParameter(INIT_PARAM_TIMEZONE));
  isWorkingFolderAccessOnly=Boolean.valueOf(context.getInitParameter(INIT_PARAM_WORKING_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;
  }
  String s_maxRowLevels=context.getInitParameter(INIT_PARAM_VIEWER_MAXCUBE_ROWLEVELS);
  try {
    maxCubeRowLevels=Integer.valueOf(s_maxRowLevels).intValue();
  }
 catch (  NumberFormatException e) {
    maxCubeRowLevels=-1;
  }
  String s_maxColumnLevels=context.getInitParameter(INIT_PARAM_VIEWER_MAXCUBE_COLUMNLEVELS);
  try {
    maxCubeColumnLevels=Integer.valueOf(s_maxColumnLevels).intValue();
  }
 catch (  NumberFormatException e) {
    maxCubeColumnLevels=-1;
  }
  String s_cubeMemSize=context.getInitParameter(INIT_PARAM_VIEWER_CUBEMEMSIZE);
  try {
    cubeMemorySize=Integer.valueOf(s_cubeMemSize).intValue();
  }
 catch (  NumberFormatException e) {
    cubeMemorySize=0;
  }
  String initResourceFolder=context.getInitParameter(INIT_PARAM_BIRT_RESOURCE_PATH);
  if (isDesigner && initResourceFolder == null)   initResourceFolder="String_Node_Str" + IBirtConstants.SYS_PROP_RESOURCE_PATH + "String_Node_Str";
  birtResourceFolder=processRealPath(context,initResourceFolder,null,false);
  if (isDesigner) {
    isOverWrite=true;
  }
 else {
    String s_overwrite=DataUtil.trimString(context.getInitParameter(INIT_PARAM_OVERWRITE_DOCUMENT));
    if ("String_Node_Str".equalsIgnoreCase(s_overwrite)) {
      isOverWrite=true;
    }
 else {
      isOverWrite=false;
    }
  }
  initProps=initViewerProps(context,initProps);
  if (loggers == null) {
    loggers=new HashMap();
  }
  for (Iterator i=initProps.keySet().iterator(); i.hasNext(); ) {
    String name=(String)i.next();
    if (name.startsWith("String_Node_Str")) {
      String loggerName=name.replaceFirst("String_Node_Str","String_Node_Str");
      String levelName=(String)initProps.get(name);
      loggers.put(loggerName,levelName);
      i.remove();
    }
  }
  String flag=DataUtil.trimString(context.getInitParameter(INIT_PARAM_PRINT_SERVERSIDE));
  if (IBirtConstants.VAR_ON.equalsIgnoreCase(flag)) {
    isSupportedPrintOnServer=true;
  }
 else   if (IBirtConstants.VAR_OFF.equalsIgnoreCase(flag)) {
    isSupportedPrintOnServer=false;
  }
  String s_agentstyle=context.getInitParameter(INIT_PARAM_AGENTSTYLE_ENGINE);
  if ("String_Node_Str".equalsIgnoreCase(s_agentstyle))   isAgentStyle=false;
  String exportFilenameGeneratorClassName=context.getInitParameter(INIT_PARAM_FILENAME_GENERATOR_CLASS);
  if (exportFilenameGeneratorClassName != null) {
    Object generatorInstance=null;
    try {
      Class generatorClass=Class.forName(exportFilenameGeneratorClassName);
      generatorInstance=generatorClass.newInstance();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (generatorInstance != null) {
      if (generatorInstance instanceof IFilenameGeneratorFactory) {
        exportFilenameGenerator=((IFilenameGeneratorFactory)generatorInstance).createFilenameGenerator(context);
      }
 else       if (generatorInstance instanceof IFilenameGenerator) {
        exportFilenameGenerator=(IFilenameGenerator)generatorInstance;
      }
    }
  }
  if (exportFilenameGenerator == null) {
    exportFilenameGenerator=new DefaultFilenameGenerator();
  }
  initViewingSessionConfig(documentFolder,imageFolder);
  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;
  if ("String_Node_Str".equalsIgnoreCase(System.getProperty(IBirtConstants.SYS_PROP_BIRT_ISDESIGNER)))   isDesigner=true;
  String workingPath="String_Node_Str" + IBirtConstants.SYS_PROP_WORKING_PATH + "String_Node_Str";
  workingFolder=processWorkingFolder(context,context.getInitParameter(INIT_PARAM_WORKING_DIR));
  String initDocumentFolder=context.getInitParameter(INIT_PARAM_DOCUMENT_FOLDER);
  if (isDesigner && initDocumentFolder == null)   initDocumentFolder=workingPath + IBirtConstants.DEFAULT_DOCUMENT_FOLDER;
  String documentFolder=processRealPath(context,initDocumentFolder,IBirtConstants.DEFAULT_DOCUMENT_FOLDER,true);
  String initImageFolder=context.getInitParameter(ParameterAccessor.INIT_PARAM_IMAGE_DIR);
  if (isDesigner && initImageFolder == null)   initImageFolder=workingPath + IBirtConstants.DEFAULT_IMAGE_FOLDER;
  String imageFolder=processRealPath(context,initImageFolder,IBirtConstants.DEFAULT_IMAGE_FOLDER,true);
  String initLogFolder=context.getInitParameter(ParameterAccessor.INIT_PARAM_LOG_DIR);
  if (isDesigner && initLogFolder == null)   initLogFolder=workingPath + IBirtConstants.DEFAULT_LOGS_FOLDER;
  logFolder=processRealPath(context,initLogFolder,IBirtConstants.DEFAULT_LOGS_FOLDER,true);
  logLevel=context.getInitParameter(ParameterAccessor.INIT_PARAM_LOG_LEVEL);
  if (logLevel == null)   logLevel=IBirtConstants.DEFAULT_LOGS_LEVEL;
  String rootPath="String_Node_Str" + IBirtConstants.SYS_PROP_ROOT_PATH + "String_Node_Str";
  String initScriptlibFolder=context.getInitParameter(ParameterAccessor.INIT_PARAM_SCRIPTLIB_DIR);
  if (isDesigner && initScriptlibFolder == null)   initScriptlibFolder=rootPath + IBirtConstants.DEFAULT_SCRIPTLIB_FOLDER;
  scriptLibDir=processRealPath(context,initScriptlibFolder,IBirtConstants.DEFAULT_SCRIPTLIB_FOLDER,false);
  webAppLocale=getLocaleFromString(context.getInitParameter(INIT_PARAM_LOCALE));
  if (webAppLocale == null)   webAppLocale=Locale.getDefault();
  webAppTimeZone=getTimeZoneFromString(context.getInitParameter(INIT_PARAM_TIMEZONE));
  isWorkingFolderAccessOnly=Boolean.valueOf(context.getInitParameter(INIT_PARAM_WORKING_FOLDER_ACCESS_ONLY)).booleanValue();
  urlReportPathPolicy=context.getInitParameter(INIT_PARAM_URL_REPORT_PATH_POLICY);
  String s_maxRows=context.getInitParameter(INIT_PARAM_VIEWER_MAXROWS);
  try {
    maxRows=Integer.valueOf(s_maxRows).intValue();
  }
 catch (  NumberFormatException e) {
    maxRows=-1;
  }
  String s_maxRowLevels=context.getInitParameter(INIT_PARAM_VIEWER_MAXCUBE_ROWLEVELS);
  try {
    maxCubeRowLevels=Integer.valueOf(s_maxRowLevels).intValue();
  }
 catch (  NumberFormatException e) {
    maxCubeRowLevels=-1;
  }
  String s_maxColumnLevels=context.getInitParameter(INIT_PARAM_VIEWER_MAXCUBE_COLUMNLEVELS);
  try {
    maxCubeColumnLevels=Integer.valueOf(s_maxColumnLevels).intValue();
  }
 catch (  NumberFormatException e) {
    maxCubeColumnLevels=-1;
  }
  String s_cubeMemSize=context.getInitParameter(INIT_PARAM_VIEWER_CUBEMEMSIZE);
  try {
    cubeMemorySize=Integer.valueOf(s_cubeMemSize).intValue();
  }
 catch (  NumberFormatException e) {
    cubeMemorySize=0;
  }
  String initResourceFolder=context.getInitParameter(INIT_PARAM_BIRT_RESOURCE_PATH);
  if (isDesigner && initResourceFolder == null)   initResourceFolder="String_Node_Str" + IBirtConstants.SYS_PROP_RESOURCE_PATH + "String_Node_Str";
  birtResourceFolder=processRealPath(context,initResourceFolder,null,false);
  if (isDesigner) {
    isOverWrite=true;
  }
 else {
    String s_overwrite=DataUtil.trimString(context.getInitParameter(INIT_PARAM_OVERWRITE_DOCUMENT));
    if ("String_Node_Str".equalsIgnoreCase(s_overwrite)) {
      isOverWrite=true;
    }
 else {
      isOverWrite=false;
    }
  }
  initProps=initViewerProps(context,initProps);
  if (loggers == null) {
    loggers=new HashMap();
  }
  for (Iterator i=initProps.keySet().iterator(); i.hasNext(); ) {
    String name=(String)i.next();
    if (name.startsWith("String_Node_Str")) {
      String loggerName=name.replaceFirst("String_Node_Str","String_Node_Str");
      String levelName=(String)initProps.get(name);
      loggers.put(loggerName,levelName);
      i.remove();
    }
  }
  String flag=DataUtil.trimString(context.getInitParameter(INIT_PARAM_PRINT_SERVERSIDE));
  if (IBirtConstants.VAR_ON.equalsIgnoreCase(flag)) {
    isSupportedPrintOnServer=true;
  }
 else   if (IBirtConstants.VAR_OFF.equalsIgnoreCase(flag)) {
    isSupportedPrintOnServer=false;
  }
  String s_agentstyle=context.getInitParameter(INIT_PARAM_AGENTSTYLE_ENGINE);
  if ("String_Node_Str".equalsIgnoreCase(s_agentstyle))   isAgentStyle=false;
  String exportFilenameGeneratorClassName=context.getInitParameter(INIT_PARAM_FILENAME_GENERATOR_CLASS);
  if (exportFilenameGeneratorClassName != null) {
    Object generatorInstance=null;
    try {
      Class generatorClass=Class.forName(exportFilenameGeneratorClassName);
      generatorInstance=generatorClass.newInstance();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (generatorInstance != null) {
      if (generatorInstance instanceof IFilenameGeneratorFactory) {
        exportFilenameGenerator=((IFilenameGeneratorFactory)generatorInstance).createFilenameGenerator(context);
      }
 else       if (generatorInstance instanceof IFilenameGenerator) {
        exportFilenameGenerator=(IFilenameGenerator)generatorInstance;
      }
    }
  }
  if (exportFilenameGenerator == null) {
    exportFilenameGenerator=new DefaultFilenameGenerator();
  }
  initViewingSessionConfig(documentFolder,imageFolder);
  isInitContext=true;
}