Program: 29028
Project: 29028
Buggy source:
private HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,WebComponentDescriptor webCompDesc) throws AnnotationProcessorException {
  Class webCompClass=(Class)ainfo.getAnnotatedElement();
  if (!HttpServlet.class.isAssignableFrom(webCompClass)) {
    log(Level.SEVERE,ainfo,localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{webCompClass.getName(),WebServlet.class.getName(),HttpServlet.class.getName()}));
    return getDefaultFailedResult();
  }
  WebServlet webServletAn=(WebServlet)ainfo.getAnnotation();
  String webCompImpl=webCompDesc.getWebComponentImplementation();
  if (webCompImpl != null && webCompImpl.length() > 0 && (!webCompImpl.equals(webCompClass.getName()) || !webCompDesc.isServlet())) {
    String messageKey=null;
    String defaultMessage=null;
    if (webCompDesc.isServlet()) {
      messageKey="String_Node_Str";
      defaultMessage="String_Node_Str";
    }
 else {
      messageKey="String_Node_Str";
      defaultMessage="String_Node_Str";
    }
    log(Level.SEVERE,ainfo,localStrings.getLocalString(messageKey,defaultMessage,new Object[]{webCompDesc.getName(),webCompImpl,webCompClass.getName(),WebServlet.class.getName()}));
    return getDefaultFailedResult();
  }
  webCompDesc.setServlet(true);
  webCompDesc.setWebComponentImplementation(webCompClass.getName());
  if (webCompDesc.getUrlPatternsSet().size() == 0) {
    String[] urlPatterns=webServletAn.urlPatterns();
    if (urlPatterns == null || urlPatterns.length == 0) {
      urlPatterns=webServletAn.value();
    }
    boolean validUrlPatterns=true;
    if (urlPatterns != null && urlPatterns.length > 0) {
      for (      String up : urlPatterns) {
        if (!URLPattern.isValid(up)) {
          validUrlPatterns=false;
          break;
        }
        webCompDesc.addUrlPattern(up);
      }
    }
    if (!validUrlPatterns) {
      String urlPatternString=(urlPatterns != null) ? Arrays.toString(urlPatterns) : "String_Node_Str";
      throw new IllegalArgumentException(localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{webCompClass,urlPatternString}));
    }
  }
  if (webCompDesc.getLoadOnStartUp() == null) {
    webCompDesc.setLoadOnStartUp(webServletAn.loadOnStartup());
  }
  WebInitParam[] initParams=webServletAn.initParams();
  if (initParams != null && initParams.length > 0) {
    for (    WebInitParam initParam : initParams) {
      webCompDesc.addInitializationParameter(new EnvironmentProperty(initParam.name(),initParam.value(),initParam.description()));
    }
  }
  if (webCompDesc.getSmallIconUri() == null) {
    webCompDesc.setSmallIconUri(webServletAn.smallIcon());
  }
  if (webCompDesc.getLargeIconUri() == null) {
    webCompDesc.setLargeIconUri(webServletAn.largeIcon());
  }
  if (webCompDesc.getDescription() == null || webCompDesc.getDescription().length() == 0) {
    webCompDesc.setDescription(webServletAn.description());
  }
  if (webCompDesc.getDisplayName() == null || webCompDesc.getDisplayName().length() == 0) {
    webCompDesc.setDisplayName(webServletAn.displayName());
  }
  if (webCompDesc.isAsyncSupported() == null) {
    webCompDesc.setAsyncSupported(webServletAn.asyncSupported());
  }
  return getDefaultProcessedResult();
}

Fixed version (ground truth):
private HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,WebComponentDescriptor webCompDesc) throws AnnotationProcessorException {
  Class webCompClass=(Class)ainfo.getAnnotatedElement();
  if (!HttpServlet.class.isAssignableFrom(webCompClass)) {
    log(Level.SEVERE,ainfo,localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{webCompClass.getName(),WebServlet.class.getName(),HttpServlet.class.getName()}));
    return getDefaultFailedResult();
  }
  WebServlet webServletAn=(WebServlet)ainfo.getAnnotation();
  String servletName=getServletName(webServletAn,webCompClass);
  if (!servletName.equals(webCompDesc.getCanonicalName())) {
    return getDefaultProcessedResult();
  }
  String webCompImpl=webCompDesc.getWebComponentImplementation();
  if (webCompImpl != null && webCompImpl.length() > 0 && (!webCompImpl.equals(webCompClass.getName()) || !webCompDesc.isServlet())) {
    String messageKey=null;
    String defaultMessage=null;
    if (webCompDesc.isServlet()) {
      messageKey="String_Node_Str";
      defaultMessage="String_Node_Str";
    }
 else {
      messageKey="String_Node_Str";
      defaultMessage="String_Node_Str";
    }
    log(Level.SEVERE,ainfo,localStrings.getLocalString(messageKey,defaultMessage,new Object[]{webCompDesc.getCanonicalName(),webCompImpl,webCompClass.getName(),WebServlet.class.getName()}));
    return getDefaultFailedResult();
  }
  webCompDesc.setServlet(true);
  webCompDesc.setWebComponentImplementation(webCompClass.getName());
  if (webCompDesc.getUrlPatternsSet().size() == 0) {
    String[] urlPatterns=webServletAn.urlPatterns();
    if (urlPatterns == null || urlPatterns.length == 0) {
      urlPatterns=webServletAn.value();
    }
    boolean validUrlPatterns=true;
    if (urlPatterns != null && urlPatterns.length > 0) {
      for (      String up : urlPatterns) {
        if (!URLPattern.isValid(up)) {
          validUrlPatterns=false;
          break;
        }
        webCompDesc.addUrlPattern(up);
      }
    }
    if (!validUrlPatterns) {
      String urlPatternString=(urlPatterns != null) ? Arrays.toString(urlPatterns) : "String_Node_Str";
      throw new IllegalArgumentException(localStrings.getLocalString("String_Node_Str","String_Node_Str",new Object[]{webCompClass,urlPatternString}));
    }
  }
  if (webCompDesc.getLoadOnStartUp() == null) {
    webCompDesc.setLoadOnStartUp(webServletAn.loadOnStartup());
  }
  WebInitParam[] initParams=webServletAn.initParams();
  if (initParams != null && initParams.length > 0) {
    for (    WebInitParam initParam : initParams) {
      webCompDesc.addInitializationParameter(new EnvironmentProperty(initParam.name(),initParam.value(),initParam.description()));
    }
  }
  if (webCompDesc.getSmallIconUri() == null) {
    webCompDesc.setSmallIconUri(webServletAn.smallIcon());
  }
  if (webCompDesc.getLargeIconUri() == null) {
    webCompDesc.setLargeIconUri(webServletAn.largeIcon());
  }
  if (webCompDesc.getDescription() == null || webCompDesc.getDescription().length() == 0) {
    webCompDesc.setDescription(webServletAn.description());
  }
  if (webCompDesc.getDisplayName() == null || webCompDesc.getDisplayName().length() == 0) {
    webCompDesc.setDisplayName(webServletAn.displayName());
  }
  if (webCompDesc.isAsyncSupported() == null) {
    webCompDesc.setAsyncSupported(webServletAn.asyncSupported());
  }
  return getDefaultProcessedResult();
}