code: public static Class<?> classForNameWithException(final String name, final ClassLoader cl)
              throws ClassNotFoundException {
          if (cl != null) {
              try {
                  return Class.forName(name, false, cl);
              } catch (final ClassNotFoundException | NoClassDefFoundError e) {
                  // fall through and try with default classloader
              }
          }
          return Class.forName(name);
      }
docs: Get the Class from the class name.
  
  @param name
  the class name.
  @param cl
  the class loader to use, if null then the defining class loader of this class will
  be utilized.
  @return the Class, otherwise null if the class cannot be found.
  @throws ClassNotFoundException
  if the class cannot be found.