Program: 51196
Project: 51196
Buggy source:
public WebXmlGenerator(WebAppDescriptor applicationDescriptor){
  webAppType=new WebAppType();
  Map<String,String> contextParams=applicationDescriptor.getContextParams();
  if (contextParams != null && contextParams.size() > 0) {
    List<ContextParamType> contextParameters=new ArrayList<ContextParamType>();
    Iterator<String> contextParamIterator=contextParams.keySet().iterator();
    String paramName="String_Node_Str";
    String paramValue;
    ContextParamType contextParam;
    while (contextParamIterator.hasNext()) {
      paramName=contextParamIterator.next();
      paramValue=contextParams.get(paramName);
      contextParam=new ContextParamType();
      contextParam.setParamName(paramName);
      contextParam.setParamValue(paramValue);
      contextParameters.add(contextParam);
    }
    webAppType.setContextParam(contextParameters);
  }
  if (applicationDescriptor.getContextListenerClass() != null && !applicationDescriptor.getContextListenerClass().getName().equals("String_Node_Str")) {
    ListenerType listener=new ListenerType();
    listener.setListenerClass(applicationDescriptor.getContextListenerClass().getName());
    webAppType.setListener(listener);
  }
  ServletType servlet=new ServletType();
  servlet.setServletName("String_Node_Str");
  servlet.setServletClass(applicationDescriptor.getServletClass().getName());
  Map<String,String> initParams=applicationDescriptor.getInitParams();
  if (initParams != null) {
    List<ServletInitParamType> servletInitParams=new ArrayList<ServletInitParamType>();
    Iterator<String> initParamIterator=initParams.keySet().iterator();
    ServletInitParamType servletInitParam;
    String paramName;
    while (initParamIterator.hasNext()) {
      paramName=initParamIterator.next();
      servletInitParam=new ServletInitParamType(paramName,initParams.get(paramName));
      servletInitParams.add(servletInitParam);
    }
    servlet.setInitParam(servletInitParams);
  }
  servlet.setLoadOnStartup("String_Node_Str");
  webAppType.setServletType(servlet);
  ServletMappingType servletMapping=new ServletMappingType();
  servletMapping.setServletName("String_Node_Str");
  String urlPattern=normalizedUrlPattern(applicationDescriptor.getServletPath());
  servletMapping.setUrlPattern(urlPattern);
  webAppType.setServletMapping(servletMapping);
}

Fixed version (ground truth):
public WebXmlGenerator(WebAppDescriptor applicationDescriptor){
  webAppType=new WebAppType();
  Map<String,String> contextParams=applicationDescriptor.getContextParams();
  if (contextParams != null && contextParams.size() > 0) {
    List<ContextParamType> contextParameters=new ArrayList<ContextParamType>();
    Iterator<String> contextParamIterator=contextParams.keySet().iterator();
    String paramName="String_Node_Str";
    String paramValue;
    ContextParamType contextParam;
    while (contextParamIterator.hasNext()) {
      paramName=contextParamIterator.next();
      paramValue=contextParams.get(paramName);
      contextParam=new ContextParamType();
      contextParam.setParamName(paramName);
      contextParam.setParamValue(paramValue);
      contextParameters.add(contextParam);
    }
    webAppType.setContextParam(contextParameters);
  }
  List<ListenerType> listeners=new ArrayList<ListenerType>();
  if (applicationDescriptor.getContextListenerClass() != null && !applicationDescriptor.getContextListenerClass().getName().equals("String_Node_Str")) {
    ListenerType listener=new ListenerType();
    listener.setListenerClass(applicationDescriptor.getContextListenerClass().getName());
    listeners.add(listener);
  }
  if (applicationDescriptor.getContextAttributeListenerClass() != null && !applicationDescriptor.getContextAttributeListenerClass().getName().equals("String_Node_Str")) {
    ListenerType listener=new ListenerType();
    listener.setListenerClass(applicationDescriptor.getContextAttributeListenerClass().getName());
    listeners.add(listener);
  }
  if (applicationDescriptor.getRequestListenerClass() != null && !applicationDescriptor.getRequestListenerClass().getName().equals("String_Node_Str")) {
    ListenerType listener=new ListenerType();
    listener.setListenerClass(applicationDescriptor.getRequestListenerClass().getName());
    listeners.add(listener);
  }
  if (applicationDescriptor.getRequestAttributeListenerClass() != null && !applicationDescriptor.getRequestAttributeListenerClass().getName().equals("String_Node_Str")) {
    ListenerType listener=new ListenerType();
    listener.setListenerClass(applicationDescriptor.getRequestAttributeListenerClass().getName());
    listeners.add(listener);
  }
  if (listeners.size() > 0) {
    webAppType.setListeners(listeners);
  }
  ServletType servlet=new ServletType();
  servlet.setServletName("String_Node_Str");
  servlet.setServletClass(applicationDescriptor.getServletClass().getName());
  Map<String,String> initParams=applicationDescriptor.getInitParams();
  if (initParams != null) {
    List<ServletInitParamType> servletInitParams=new ArrayList<ServletInitParamType>();
    Iterator<String> initParamIterator=initParams.keySet().iterator();
    ServletInitParamType servletInitParam;
    String paramName;
    while (initParamIterator.hasNext()) {
      paramName=initParamIterator.next();
      servletInitParam=new ServletInitParamType(paramName,initParams.get(paramName));
      servletInitParams.add(servletInitParam);
    }
    servlet.setInitParam(servletInitParams);
  }
  servlet.setLoadOnStartup("String_Node_Str");
  webAppType.setServletType(servlet);
  ServletMappingType servletMapping=new ServletMappingType();
  servletMapping.setServletName("String_Node_Str");
  String urlPattern=normalizedUrlPattern(applicationDescriptor.getServletPath());
  servletMapping.setUrlPattern(urlPattern);
  webAppType.setServletMapping(servletMapping);
}