code: public Set<MetadataReader> findCandidateComponents(String basePackage) throws IOException {
          Set<MetadataReader> candidates = new LinkedHashSet<>();
  
          String packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX +
                  resolveBasePackage(basePackage) + "/" + this.resourcePattern;
          Resource[] resources = this.resourcePatternResolver.getResources(packageSearchPath);
  
          for (Resource resource : resources) {
              logger.trace("Scanning " + resource);
              if (resource.isReadable()) {
                  try {
                      MetadataReader metadataReader = this.metadataReaderFactory.getMetadataReader(resource);
                      if (isCandidateComponent(metadataReader)) {
                          candidates.add(metadataReader);
                      }
                  } catch (IOException e) {
                      logger.warn("Error reading " + resource, e);
                  }
              } else {
                  logger.trace("Ignored because not readable: " + resource);
              }
          }
          return candidates;
      }
docs: /*
  Scan the class path for candidate components.
  
  @param basePackage the package to check for annotated classes
  @return a corresponding Set of autodetected bean definitions