docs: @Override
      protected Class<?> findClass(final String className)
              throws ClassNotFoundException, LinkageError, SecurityException {
          final Class<?> loadedClass = findLoadedClass(className);
          if (loadedClass != null) {
              return loadedClass;
          }
  
          // Get ClassInfo for named class
          final ClassInfo classInfo = scanResult.getClassInfo(className);
  
          // Try environment classloaders first
          boolean triedClassInfoLoader = false;
          final ClassLoader[] classLoaderOrder = scanResult.getClassLoaderOrderRespectingParentDelegation();
          if (classLoaderOrder != null) {
              // Try environment classloaders
              for (final ClassLoader envClassLoader : classLoaderOrder) {
                  try {
                      return Class.forName(className, scanResult.scanSpec.initializeLoadedClasses, envClassLoader);
                  } catch (ReflectiveOperationException | LinkageError e) {
                      // Ignore
                  }
                  if (classInfo != null && envClassLoader == classInfo.classLoader) {
                      triedClassInfoLoader = true;
                  }
              }
          }
  
          // Try specific classloader for the classpath element that the classfile was obtained from
          if (!triedClassInfoLoader && classInfo != null && classInfo.classLoader != null) {
              try {
                  return Class.forName(className, scanResult.scanSpec.initializeLoadedClasses, classInfo.classLoader);
              } catch (final ReflectiveOperationException | LinkageError e) {
                  // Ignore
              }
          }
  
          // If class came from a module, and it was not able to be loaded by the environment classloader,
          // then it is possible it was a non-public class, and ClassGraph found it by ignoring class visibility
          // when reading the resources in exported packages directly. Force ClassGraph to respect JPMS
          // encapsulation rules by refusing to load modular classes that the context/system classloaders
          // could not load. (A SecurityException should be thrown above, but this is here for completeness.)
          if (classInfo != null && classInfo.classpathElement instanceof ClasspathElementModule
                  && !classInfo.isPublic()) {
              throw new ClassNotFoundException("Classfile for class " + className + " was found in a module, "
                      + "but the context and system classloaders could not load the class, probably because "
                      + "the class is not public.");
          }
  
          // Try obtaining the classfile as a resource, and defining the class from the resource content
          final ResourceList classfileResources = scanResult
                  .getResourcesWithPath(JarUtils.classNameToClassfilePath(className));
          if (classfileResources != null) {
              for (final Resource resource : classfileResources) {
                  // Iterate through resources (only loading of first resource in the list will be attempted)
                  try {
                      // Load the content of the resource, and define a class from it
                      final ByteBuffer resourceByteBuffer = resource.read();
                      return defineClass(className, resourceByteBuffer, null);
                  } catch (final IOException e) {
                      throw new ClassNotFoundException("Could not load classfile for class " + className + " : " + e);
                  } finally {
                      resource.close();
                  }
              }
          }
          throw new ClassNotFoundException("Could not load classfile for class " + className);
      }