Program: 43630
Project: 43630
Buggy source:
protected void loadSubModules() throws Throwable {
  Views vms=mainModule.getAnnotation(Views.class);
  ArrayList<ViewMaker> makers=new ArrayList<ViewMaker>();
  if (null != vms)   for (  Class<? extends ViewMaker> type : vms.value())   makers.add(type.newInstance());
  makers.add(new DefaultViewMaker());
  if (log.isDebugEnabled())   log.debugf("String_Node_Str",mainModule.getName());
  urls=makeUrlMap(ioc,context,mainModule);
  urls.add(makers,mainModule);
  Modules modules=mainModule.getAnnotation(Modules.class);
  if (null != modules) {
    if (!modules.scanPackage()) {
      for (      Class<?> module : modules.value()) {
        if (log.isDebugEnabled())         log.debugf("String_Node_Str",module.getName());
        urls.add(makers,module);
      }
    }
 else {
      for (      Class<?> module : modules.value()) {
        Package packageZ=module.getPackage();
        if (log.isDebugEnabled())         log.debugf("String_Node_Str",packageZ.getName());
        List<Class<?>> list=ResourceScanHelper.scanClasses(packageZ.getName());
        if (list != null)         for (        Class<?> md : list) {
          if (urls.add(makers,md))           if (log.isDebugEnabled())           log.debugf("String_Node_Str",md.getName());
        }
      }
    }
  }
  config.getServletContext().setAttribute(UrlMap.class.getName(),urls);
}

Fixed version (ground truth):
protected void loadSubModules() throws Throwable {
  Views vms=mainModule.getAnnotation(Views.class);
  ArrayList<ViewMaker> makers=new ArrayList<ViewMaker>();
  if (null != vms)   for (  Class<? extends ViewMaker> type : vms.value())   makers.add(type.newInstance());
  makers.add(new DefaultViewMaker());
  if (log.isDebugEnabled())   log.debugf("String_Node_Str",mainModule.getName());
  urls=makeUrlMap(ioc,context,mainModule);
  urls.add(makers,mainModule);
  Modules modules=mainModule.getAnnotation(Modules.class);
  Set<Class<?>> subModules=new HashSet<Class<?>>();
  if (null != modules) {
    for (    Class<?> module : modules.value()) {
      subModules.add(module);
    }
    if (modules.scanPackage()) {
      for (      Class<?> module : modules.value()) {
        Package packageZ=module.getPackage();
        if (log.isDebugEnabled())         log.debugf("String_Node_Str",packageZ.getName());
        List<Class<?>> list=ResourceScanHelper.scanClasses(packageZ.getName());
        if (list != null)         for (        Class<?> classZ : list)         if (classZ.getPackage().equals(mainModule.getPackage()))         subModules.add(classZ);
      }
    }
  }
  if (config.getInitParameter("String_Node_Str") != null) {
    String scanPackages=config.getInitParameter("String_Node_Str").trim();
    String[] packages=scanPackages.split("String_Node_Str");
    for (int i=0; i < packages.length; i++)     if (packages[i].trim().length() > 0) {
      if (log.isDebugEnabled())       log.debugf("String_Node_Str",packages[i].trim());
      List<Class<?>> list=ResourceScanHelper.scanClasses(packages[i].trim());
      for (      Class<?> classZ : list)       if (isSubModule(classZ))       subModules.add(classZ);
    }
  }
  subModules.remove(mainModule);
  for (  Class<?> module : subModules) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",module.getName());
    urls.add(makers,module);
  }
  config.getServletContext().setAttribute(UrlMap.class.getName(),urls);
}