Call Class.forName(className), but return null if any exception is thrown.

@param className
The class name to load.
@return The class of the requested name, or null if an exception was thrown while trying to load the class.
3948
public static Class<?> classForNameOrNull(final String className) {
        try {
            return Class.forName(className);
        } catch (final ReflectiveOperationException | LinkageError e) {
            return null;
        }
    }
19573
protected Class<?> loadClass(String clazz) throws ClassNotFoundException {
		if (this.classLoader == null){
			return Class.forName(clazz);
		}

		return Class.forName(clazz, true, this.classLoader);

	}
799286
@SuppressWarnings("rawtypes")
    public static Class loadClass(String name) throws ClassNotFoundException {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        return (loader == null) ? Class.forName(name) : loader.loadClass(name);
    }
1142344
public static Class<? extends WebPage> loadClass(String className) throws ClassNotFoundException {
		return Class.forName(className).asSubclass(WebPage.class);
	}
622565
@Override
	public Class<?> loadClass(String className, boolean resolveIt) {
		try {
			return cl.loadClass(className);
		} catch(ClassNotFoundException e) {
			return null;
		}
	}
602085
protected Class<?> classForName(String name) throws ClassNotFoundException {
      try {
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        if (contextClassLoader != null) {
          return Class.forName(name, false, contextClassLoader);
        }
      } catch (Throwable e) {
        // ignore
      }
      return Class.forName(name, false, getClass().getClassLoader());
    }
785672
private synchronized Class<?> getClass(String className) throws Exception {
        // see if we need to invalidate the class
        ClassInformation classInfo = classInformation.get(className);
        File classFile = new File(classInfo.pluginPath);
        if (classFile.lastModified() > classInfo.lastModified) {
            logger.info("Class {} has been modified, reloading", className);
            logger.info("Thread ID: {}", Thread.currentThread().getId());
            classInfo.loaded = false;
            classInformation.put(className, classInfo);

            // also cleanup anything in methodInformation with this className so it gets reloaded
            Iterator<Map.Entry<String, com.groupon.odo.proxylib.models.Method>> iter = methodInformation.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry<String, com.groupon.odo.proxylib.models.Method> entry = iter.next();
                if (entry.getKey().startsWith(className)) {
                    iter.remove();
                }
            }
        }

        if (!classInfo.loaded) {
            loadClass(className);
        }

        return classInfo.loadedClass;
    }
66638
public static Class forName(String className) {
        try {
            return Class.forName(className);
        } catch (ClassNotFoundException e) {
            if (aliasClassMap.containsKey(className)) {
                return aliasClassMap.get(className);
            }

            throw new BeanMappingException("forName class[" + className + "] is error!", e);
        }
    }
991984
private Class loadClass(final String name) {

		ClassLoader loader = NodeExtender.getClassLoader();
		Class loadedClass  = null;

		if (loader == null) {
			loader = getClass().getClassLoader();
		}

		try {

			loadedClass = Class.forName(name, true, loader);

		} catch (Throwable ignore) {}

		if (loadedClass == null) {

			try {

				loadedClass = Class.forName(name);

			} catch (Throwable ignore) {}
		}

		return loadedClass;
	}
120714
public static String extractName(String className) {
	if (className == null) return null;
	int index = className.lastIndexOf('.');
	if (index != -1) return className.substring(index + 1);
	return className;
    }
950996
public static Class<?> lenientClassForName(String className) throws ClassNotFoundException {
    try {
      // TODO: consider whether any control over class loader is really needed here
      // (forName(className, true, Thread.currentThread().getContextClassLoader())?)
      return Class.forName(className);
    } catch (ClassNotFoundException ignored) {
      // try replacing the last dot with a $, in case that helps
      // example: tutorial.Tutorial.Benchmark1 becomes tutorial.Tutorial$Benchmark1
      // amusingly, the $ character means three different things in this one line alone
      String newName = className.replaceFirst("\\.([^.]+)$", "\\$$1");
      return Class.forName(newName);
    }
  }
437548
static <T> Optional<Class<? extends T>> getClass(final String className) {
        try {
            @SuppressWarnings("unchecked")
            final Optional<Class<? extends T>> clazz = Optional.<Class<? extends T>>of((Class<T>) Class.forName(className));
            return clazz;
        } catch (final ClassNotFoundException e) {
            return Optional.empty();
        }
    }
144344
public static Class getClass(String name) throws ClassNotFoundException
    {
        try
        {
            return Class.forName(name);
        }
        catch (ClassNotFoundException ex)
        {
            throw new ClassNotFoundException(name);
        }
    }
1158527
protected static Class findClass(final String className) throws ClassNotFoundException {
        try {
            return Thread.currentThread().getContextClassLoader().loadClass(className);
        } catch (ClassNotFoundException e) {
            try {
                return Class.forName(className);
            } catch (ClassNotFoundException e1) {
                return MavenCoordHelper.class.getClassLoader().loadClass(className);
            }
        }
    }
986551
public Class<?> findClass(String className) throws ClassNotFoundException {
        for (String skip : SKIP_CLASSES) {
            if (skip.equals(className)) {
                return null;
            }
        }

        for (ClassLoader classLoader : getClassLoaders()) {
            try {
                return classLoader.loadClass(className);
            } catch (ClassNotFoundException e) {
                // ignore
            }
        }
        return Class.forName(className);
    }
800257
public static Class classForName(String name) throws ClassNotFoundException {
		try {
			return Thread.currentThread().getContextClassLoader().loadClass(name);
		}
		catch (Exception e) {
			return Class.forName(name);
		}
	}
969088
@Override
    @FFDCIgnore(ClassNotFoundException.class)
    public Class<?> classForName(String className)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        {
            Tr.debug(tc, "Loading class " + className + " using classloader " + delegate);
        }
        try
        {
            return delegate.loadClass(className);
        } catch (ClassNotFoundException e)
        {
            return loadFromWeldBundleCL(className);
        }
    }