Program: 15588
Project: 15588
Buggy source:
private void initialize() throws InitParamValueException, MalformedWebXmlException, ConflictingInitParamsException {
  config=createConfiguration();
  final String iciInitParamValue=getInitParameter(Configuration.INCOMPATIBLE_IMPROVEMENTS);
  if (iciInitParamValue != null) {
    try {
      config.setSetting(Configuration.INCOMPATIBLE_IMPROVEMENTS,iciInitParamValue);
    }
 catch (    Exception e) {
      throw new InitParamValueException(Configuration.INCOMPATIBLE_IMPROVEMENTS,iciInitParamValue,e);
    }
  }
  config.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER);
  config.setLogTemplateExceptions(false);
  contentType=DEFAULT_CONTENT_TYPE;
  wrapper=createObjectWrapper();
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + wrapper);
  }
  config.setObjectWrapper(wrapper);
  templatePath=getInitParameter(INIT_PARAM_TEMPLATE_PATH);
  if (templatePath == null)   templatePath="String_Node_Str";
  try {
    config.setTemplateLoader(createTemplateLoader(templatePath));
  }
 catch (  Exception e) {
    throw new InitParamValueException(INIT_PARAM_TEMPLATE_PATH,templatePath,e);
  }
  Enumeration initpnames=getServletConfig().getInitParameterNames();
  while (initpnames.hasMoreElements()) {
    final String name=(String)initpnames.nextElement();
    final String value=getInitParameter(name);
    if (name == null) {
      throw new MalformedWebXmlException("String_Node_Str" + "String_Node_Str");
    }
    if (value == null) {
      throw new MalformedWebXmlException("String_Node_Str" + StringUtil.jQuote(value) + "String_Node_Str"+ "String_Node_Str");
    }
    try {
      if (name.equals(DEPR_INITPARAM_OBJECT_WRAPPER) || name.equals(Configurable.OBJECT_WRAPPER_KEY) || name.equals(INIT_PARAM_TEMPLATE_PATH)|| name.equals(Configuration.INCOMPATIBLE_IMPROVEMENTS)) {
      }
 else       if (name.equals(DEPR_INITPARAM_ENCODING)) {
        if (getInitParameter(Configuration.DEFAULT_ENCODING_KEY) != null) {
          throw new ConflictingInitParamsException(Configuration.DEFAULT_ENCODING_KEY,DEPR_INITPARAM_ENCODING);
        }
        config.setDefaultEncoding(value);
      }
 else       if (name.equals(DEPR_INITPARAM_TEMPLATE_DELAY)) {
        if (getInitParameter(Configuration.TEMPLATE_UPDATE_DELAY_KEY) != null) {
          throw new ConflictingInitParamsException(Configuration.TEMPLATE_UPDATE_DELAY_KEY,DEPR_INITPARAM_TEMPLATE_DELAY);
        }
        try {
          config.setTemplateUpdateDelay(Integer.parseInt(value));
        }
 catch (        NumberFormatException e) {
        }
      }
 else       if (name.equals(DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER)) {
        if (getInitParameter(Configurable.TEMPLATE_EXCEPTION_HANDLER_KEY) != null) {
          throw new ConflictingInitParamsException(Configurable.TEMPLATE_EXCEPTION_HANDLER_KEY,DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER);
        }
        if (DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER_RETHROW.equals(value)) {
          config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
        }
 else         if (DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER_DEBUG.equals(value)) {
          config.setTemplateExceptionHandler(TemplateExceptionHandler.DEBUG_HANDLER);
        }
 else         if (DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER_HTML_DEBUG.equals(value)) {
          config.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER);
        }
 else         if (DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER_IGNORE.equals(value)) {
          config.setTemplateExceptionHandler(TemplateExceptionHandler.IGNORE_HANDLER);
        }
 else {
          throw new InitParamValueException(DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER,value,"String_Node_Str");
        }
      }
 else       if (name.equals(INIT_PARAM_NO_CACHE)) {
        nocache=StringUtil.getYesNo(value);
      }
 else       if (name.equals(INIT_PARAM_BUFFER_SIZE)) {
        bufferSize=new Integer(parseSize(value));
      }
 else       if (name.equals(DEPR_INITPARAM_DEBUG)) {
        if (getInitParameter(INIT_PARAM_DEBUG) != null) {
          throw new ConflictingInitParamsException(INIT_PARAM_DEBUG,DEPR_INITPARAM_DEBUG);
        }
        debug=StringUtil.getYesNo(value);
      }
 else       if (name.equals(INIT_PARAM_DEBUG)) {
        debug=StringUtil.getYesNo(value);
      }
 else       if (name.equals(INIT_PARAM_CONTENT_TYPE)) {
        contentType=value;
      }
 else       if (name.equals(INIT_PARAM_EXCEPTION_ON_MISSING_TEMPLATE)) {
        exceptionOnMissingTemplate=StringUtil.getYesNo(value);
      }
 else       if (name.equals(INIT_PARAM_META_INF_TLD_LOCATIONS)) {
        ;
        metaInfTldSources=parseAsMetaInfTldLocations(value);
      }
 else       if (name.equals(INIT_PARAM_CLASSPATH_TLDS)) {
        ;
        classpathTlds=parseCommaSeparatedList(value);
      }
 else {
        config.setSetting(name,value);
      }
    }
 catch (    ConflictingInitParamsException e) {
      throw e;
    }
catch (    Exception e) {
      throw new InitParamValueException(name,value,e);
    }
  }
  noCharsetInContentType=true;
  int i=contentType.toLowerCase().indexOf("String_Node_Str");
  if (i != -1) {
    char c=' ';
    i--;
    while (i >= 0) {
      c=contentType.charAt(i);
      if (!Character.isWhitespace(c))       break;
      i--;
    }
    if (i == -1 || c == ';') {
      noCharsetInContentType=false;
    }
  }
}

Fixed version (ground truth):
private void initialize() throws InitParamValueException, MalformedWebXmlException, ConflictingInitParamsException {
  config=createConfiguration();
  final String iciInitParamValue=getInitParameter(Configuration.INCOMPATIBLE_IMPROVEMENTS);
  if (iciInitParamValue != null) {
    try {
      config.setSetting(Configuration.INCOMPATIBLE_IMPROVEMENTS,iciInitParamValue);
    }
 catch (    Exception e) {
      throw new InitParamValueException(Configuration.INCOMPATIBLE_IMPROVEMENTS,iciInitParamValue,e);
    }
  }
  if (!config.isTemplateExceptionHandlerExplicitlySet()) {
    config.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER);
  }
  if (!config.isLogTemplateExceptionsExplicitlySet()) {
    config.setLogTemplateExceptions(false);
  }
  contentType=DEFAULT_CONTENT_TYPE;
  wrapper=createObjectWrapper();
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + wrapper);
  }
  config.setObjectWrapper(wrapper);
  templatePath=getInitParameter(INIT_PARAM_TEMPLATE_PATH);
  if (templatePath == null && !config.isTemplateLoaderExplicitlySet()) {
    templatePath="String_Node_Str";
  }
  if (templatePath != null) {
    try {
      config.setTemplateLoader(createTemplateLoader(templatePath));
    }
 catch (    Exception e) {
      throw new InitParamValueException(INIT_PARAM_TEMPLATE_PATH,templatePath,e);
    }
  }
  Enumeration initpnames=getServletConfig().getInitParameterNames();
  while (initpnames.hasMoreElements()) {
    final String name=(String)initpnames.nextElement();
    final String value=getInitParameter(name);
    if (name == null) {
      throw new MalformedWebXmlException("String_Node_Str" + "String_Node_Str");
    }
    if (value == null) {
      throw new MalformedWebXmlException("String_Node_Str" + StringUtil.jQuote(name) + "String_Node_Str"+ "String_Node_Str");
    }
    try {
      if (name.equals(DEPR_INITPARAM_OBJECT_WRAPPER) || name.equals(Configurable.OBJECT_WRAPPER_KEY) || name.equals(INIT_PARAM_TEMPLATE_PATH)|| name.equals(Configuration.INCOMPATIBLE_IMPROVEMENTS)) {
      }
 else       if (name.equals(DEPR_INITPARAM_ENCODING)) {
        if (getInitParameter(Configuration.DEFAULT_ENCODING_KEY) != null) {
          throw new ConflictingInitParamsException(Configuration.DEFAULT_ENCODING_KEY,DEPR_INITPARAM_ENCODING);
        }
        config.setDefaultEncoding(value);
      }
 else       if (name.equals(DEPR_INITPARAM_TEMPLATE_DELAY)) {
        if (getInitParameter(Configuration.TEMPLATE_UPDATE_DELAY_KEY) != null) {
          throw new ConflictingInitParamsException(Configuration.TEMPLATE_UPDATE_DELAY_KEY,DEPR_INITPARAM_TEMPLATE_DELAY);
        }
        try {
          config.setTemplateUpdateDelay(Integer.parseInt(value));
        }
 catch (        NumberFormatException e) {
        }
      }
 else       if (name.equals(DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER)) {
        if (getInitParameter(Configurable.TEMPLATE_EXCEPTION_HANDLER_KEY) != null) {
          throw new ConflictingInitParamsException(Configurable.TEMPLATE_EXCEPTION_HANDLER_KEY,DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER);
        }
        if (DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER_RETHROW.equals(value)) {
          config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
        }
 else         if (DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER_DEBUG.equals(value)) {
          config.setTemplateExceptionHandler(TemplateExceptionHandler.DEBUG_HANDLER);
        }
 else         if (DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER_HTML_DEBUG.equals(value)) {
          config.setTemplateExceptionHandler(TemplateExceptionHandler.HTML_DEBUG_HANDLER);
        }
 else         if (DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER_IGNORE.equals(value)) {
          config.setTemplateExceptionHandler(TemplateExceptionHandler.IGNORE_HANDLER);
        }
 else {
          throw new InitParamValueException(DEPR_INITPARAM_TEMPLATE_EXCEPTION_HANDLER,value,"String_Node_Str");
        }
      }
 else       if (name.equals(INIT_PARAM_NO_CACHE)) {
        nocache=StringUtil.getYesNo(value);
      }
 else       if (name.equals(INIT_PARAM_BUFFER_SIZE)) {
        bufferSize=new Integer(parseSize(value));
      }
 else       if (name.equals(DEPR_INITPARAM_DEBUG)) {
        if (getInitParameter(INIT_PARAM_DEBUG) != null) {
          throw new ConflictingInitParamsException(INIT_PARAM_DEBUG,DEPR_INITPARAM_DEBUG);
        }
        debug=StringUtil.getYesNo(value);
      }
 else       if (name.equals(INIT_PARAM_DEBUG)) {
        debug=StringUtil.getYesNo(value);
      }
 else       if (name.equals(INIT_PARAM_CONTENT_TYPE)) {
        contentType=value;
      }
 else       if (name.equals(INIT_PARAM_EXCEPTION_ON_MISSING_TEMPLATE)) {
        exceptionOnMissingTemplate=StringUtil.getYesNo(value);
      }
 else       if (name.equals(INIT_PARAM_META_INF_TLD_LOCATIONS)) {
        ;
        metaInfTldSources=parseAsMetaInfTldLocations(value);
      }
 else       if (name.equals(INIT_PARAM_CLASSPATH_TLDS)) {
        ;
        classpathTlds=parseCommaSeparatedList(value);
      }
 else {
        config.setSetting(name,value);
      }
    }
 catch (    ConflictingInitParamsException e) {
      throw e;
    }
catch (    Exception e) {
      throw new InitParamValueException(name,value,e);
    }
  }
  noCharsetInContentType=true;
  int i=contentType.toLowerCase().indexOf("String_Node_Str");
  if (i != -1) {
    char c=' ';
    i--;
    while (i >= 0) {
      c=contentType.charAt(i);
      if (!Character.isWhitespace(c))       break;
      i--;
    }
    if (i == -1 || c == ';') {
      noCharsetInContentType=false;
    }
  }
}