code: @Override
      protected Set<Class<?>> findTypesToRegister() {
          Set<Class<?>> typesToRegister = new HashSet<Class<?>>();
          try {
              String packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX +
                      resolveBasePackage(basePackage) + "/" + this.resourcePattern;
              Resource[] resources = this.resourcePatternResolver.getResources(packageSearchPath);
              boolean traceEnabled = log.isTraceEnabled();
              boolean debugEnabled = log.isDebugEnabled();
              for (Resource resource : resources) {
                  if (traceEnabled) {
                      log.trace("Scanning " + resource);
                  }
                  if (resource.isReadable()) {
                      try {
                          MetadataReader metadataReader = this.metadataReaderFactory.getMetadataReader(resource);
                          if (applyFilters(metadataReader)) {
                              if (isCandidateForAmf(metadataReader.getAnnotationMetadata())) {
                                  if (debugEnabled) {
                                      log.debug("Identified candidate AMF class: " + resource);
                                  }
                                  typesToRegister.add(ClassUtils.forName(metadataReader.getAnnotationMetadata().getClassName(), this.beanClassLoader));
                              }
                              else {
                                  if (debugEnabled) {
                                      log.debug("Ignored because not a concrete top-level class: " + resource);
                                  }
                              }
                          }
                          else {
                              if (traceEnabled) {
                                  log.trace("Ignored because not matching any filter: " + resource);
                              }
                          }
                      }
                      catch (Throwable ex) {
                          throw new BeanDefinitionStoreException(
                                  "Failed to read candidate AMF class: " + resource, ex);
                      }
                  }
                  else {
                      if (traceEnabled) {
                          log.trace("Ignored because not readable: " + resource);
                      }
                  }
              }
          }
          catch (IOException ex) {
              throw new BeanDefinitionStoreException("I/O failure during classpath scanning", ex);
          }
          return typesToRegister;
      }
docs: {@inheritDoc}