Program: 80284
Project: 80284
Buggy source:
public static Set<Class<?>> scanModules(Class<?> mainModule){
  Modules ann=mainModule.getAnnotation(Modules.class);
  boolean scan=null == ann ? false : ann.scanPackage();
  List<Class<?>> list=new LinkedList<Class<?>>();
  list.add(mainModule);
  if (null != ann) {
    for (    Class<?> module : ann.value()) {
      list.add(module);
    }
  }
  Set<Class<?>> modules=new HashSet<Class<?>>();
  if (null != ann && ann.packages() != null && ann.packages().length > 0) {
    for (    String packageName : ann.packages()) {
      if (packageName.equals("String_Node_Str")) {
        String[] pkgs=Strings.splitIgnoreBlank(Mvcs.dynamic_modules,"String_Node_Str");
        if (null != pkgs)         for (        String pkg : pkgs) {
          scanModuleInPackage(modules,pkg);
        }
      }
 else {
        scanModuleInPackage(modules,packageName);
      }
    }
  }
  for (  Class<?> type : list) {
    try {
      URL location=type.getProtectionDomain().getCodeSource().getLocation();
      if (log.isDebugEnabled())       log.debugf("String_Node_Str",location);
    }
 catch (    NullPointerException e) {
    }
    Scans.me().registerLocation(type);
  }
  for (  Class<?> type : list) {
    if (scan) {
      scanModuleInPackage(modules,type.getPackage().getName());
    }
 else {
      if (isModule(type)) {
        if (log.isDebugEnabled())         log.debugf("String_Node_Str",type.getName());
        modules.add(type);
      }
 else       if (log.isTraceEnabled()) {
        log.tracef("String_Node_Str",type.getName());
      }
    }
  }
  return modules;
}

Fixed version (ground truth):
public static Set<Class<?>> scanModules(Ioc ioc,Class<?> mainModule){
  Modules ann=mainModule.getAnnotation(Modules.class);
  boolean scan=null == ann ? false : ann.scanPackage();
  Set<Class<?>> forScans=new HashSet<Class<?>>();
  Set<Class<?>> modules=new HashSet<Class<?>>();
  forScans.add(mainModule);
  if (null != ann) {
    for (    Class<?> module : ann.value()) {
      forScans.add(module);
    }
    for (    String str : ann.by()) {
      ModuleScanner ms;
      if (str.startsWith("String_Node_Str")) {
        String nm=str.substring("String_Node_Str".length());
        ms=ioc.get(ModuleScanner.class,nm);
      }
 else {
        try {
          Class<?> klass=Class.forName(str);
          Mirror<?> mi=Mirror.me(klass);
          ms=(ModuleScanner)mi.born();
        }
 catch (        ClassNotFoundException e) {
          throw Lang.wrapThrow(e);
        }
      }
      List<Class<?>> list=ms.scan();
      if (null != list)       for (      Class<?> type : list) {
        if (isModule(type)) {
          modules.add(type);
        }
      }
    }
    if (ann.packages() != null && ann.packages().length > 0) {
      for (      String packageName : ann.packages()) {
        scanModuleInPackage(modules,packageName);
      }
    }
  }
  for (  Class<?> type : forScans) {
    try {
      URL location=type.getProtectionDomain().getCodeSource().getLocation();
      if (log.isDebugEnabled())       log.debugf("String_Node_Str",location);
    }
 catch (    NullPointerException e) {
    }
    Scans.me().registerLocation(type);
  }
  for (  Class<?> type : forScans) {
    if (scan) {
      scanModuleInPackage(modules,type.getPackage().getName());
    }
 else {
      if (isModule(type)) {
        if (log.isDebugEnabled())         log.debugf("String_Node_Str",type.getName());
        modules.add(type);
      }
 else       if (log.isTraceEnabled()) {
        log.tracef("String_Node_Str",type.getName());
      }
    }
  }
  return modules;
}