Program: 29485
Project: 29485
Buggy source:
private void hasValidMapping(WebBundleDescriptor descriptor,String filterName){
  Enumeration filtermapperEnum=descriptor.getServletFilterMappingDescriptors().elements();
  if (filtermapperEnum.hasMoreElements()) {
    ServletFilterMappingDescriptor filterMapper=null;
    boolean mappingFound=false;
    do {
      filterMapper=(ServletFilterMappingDescriptor)filtermapperEnum.nextElement();
      String filterMapping=filterMapper.getName();
      mappingFound=filterName.equals(filterMapping);
    }
 while (!mappingFound && filtermapperEnum.hasMoreElements());
    if (mappingFound) {
      List<String> urlPatterns=filterMapper.getURLPatterns();
      for (      String url : urlPatterns) {
        if (!((url.startsWith("String_Node_Str")) || ((url.startsWith("String_Node_Str")) && (url.endsWith("String_Node_Str"))) || (url.startsWith("String_Node_Str")))) {
          addErrorDetails(result,compName);
          result.failed(smh.getLocalString(getClass().getName() + "String_Node_Str","String_Node_Str" + "String_Node_Str",new Object[]{filterName,url}));
        }
      }
      List<String> servletsInFilter=filterMapper.getServletNames();
      final String ALL_SERVLETS_NAME="String_Node_Str";
      servletsInFilter.remove(ALL_SERVLETS_NAME);
      List<String> servletsInWAR=new ArrayList<String>();
      if (servletsInFilter.size() > 0) {
        Set servletDescriptor=descriptor.getServletDescriptors();
        Iterator itr=servletDescriptor.iterator();
        while (itr.hasNext()) {
          WebComponentDescriptor servlet=(WebComponentDescriptor)itr.next();
          servletsInWAR.add(servlet.getCanonicalName());
        }
        if (!(servletsInWAR != null && servletsInWAR.containsAll(servletsInFilter))) {
          addErrorDetails(result,compName);
          result.failed(smh.getLocalString(getClass().getName() + "String_Node_Str","String_Node_Str",new Object[]{filterName}));
        }
      }
    }
  }
}

Fixed version (ground truth):
private void hasValidMapping(WebBundleDescriptor descriptor,String filterName){
  Enumeration filtermapperEnum=descriptor.getServletFilterMappingDescriptors().elements();
  if (filtermapperEnum.hasMoreElements()) {
    ServletFilterMappingDescriptor filterMapper=null;
    boolean mappingFound=false;
    do {
      filterMapper=(ServletFilterMappingDescriptor)filtermapperEnum.nextElement();
      String filterMapping=filterMapper.getName();
      mappingFound=filterName.equals(filterMapping);
    }
 while (!mappingFound && filtermapperEnum.hasMoreElements());
    if (mappingFound) {
      List<String> urlPatterns=filterMapper.getUrlPatterns();
      for (      String url : urlPatterns) {
        if (!((url.startsWith("String_Node_Str")) || ((url.startsWith("String_Node_Str")) && (url.endsWith("String_Node_Str"))) || (url.startsWith("String_Node_Str")))) {
          addErrorDetails(result,compName);
          result.failed(smh.getLocalString(getClass().getName() + "String_Node_Str","String_Node_Str" + "String_Node_Str",new Object[]{filterName,url}));
        }
      }
      List<String> servletsInFilter=filterMapper.getServletNames();
      final String ALL_SERVLETS_NAME="String_Node_Str";
      servletsInFilter.remove(ALL_SERVLETS_NAME);
      List<String> servletsInWAR=new ArrayList<String>();
      if (servletsInFilter.size() > 0) {
        Set servletDescriptor=descriptor.getServletDescriptors();
        Iterator itr=servletDescriptor.iterator();
        while (itr.hasNext()) {
          WebComponentDescriptor servlet=(WebComponentDescriptor)itr.next();
          servletsInWAR.add(servlet.getCanonicalName());
        }
        if (!(servletsInWAR != null && servletsInWAR.containsAll(servletsInFilter))) {
          addErrorDetails(result,compName);
          result.failed(smh.getLocalString(getClass().getName() + "String_Node_Str","String_Node_Str",new Object[]{filterName}));
        }
      }
    }
  }
}