code: private static Class<?> findClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
          try {
              Class<?> spiClass;
              if (classLoader == null) {
                  spiClass = Class.forName(className);
              } else {
                  try {
                      spiClass = Class.forName(className, false, classLoader);
                  } catch (ClassNotFoundException ex) {
                      spiClass = Class.forName(className);
                  }
              }
              return spiClass;
          } catch (ClassNotFoundException x) {
              throw x;
          } catch (Exception x) {
              throw new ClassNotFoundException("Factory " + className + " could not be instantiated: " + x, x);
          }
      }
docs: Creates an instance of the specified class using the specified <code>ClassLoader</code> object.
  
  @throws ClassNotFoundException if the given class could not be found or could not be instantiated