code: @SuppressWarnings("rawtypes")
  	public static Class loadClass(Class loadClass, String name,
  								  boolean checkParents) throws ClassNotFoundException {
  		ClassNotFoundException ex = null;
  		Class<?> c = null;
  		ClassLoader loader = Thread.currentThread().getContextClassLoader();
  		while (c == null && loader != null) {
  			try {
  				c = loader.loadClass(name);
  			} catch (ClassNotFoundException e) {
  				if (ex == null) {
  					ex = e;
  				}
  			}
  			loader = (c == null && checkParents) ? loader.getParent() : null;
  		}
  
  		loader = loadClass == null ? null : loadClass.getClassLoader();
  		while (c == null && loader != null) {
  			try {
  				c = loader.loadClass(name);
  			} catch (ClassNotFoundException e) {
  				if (ex == null) {
  					ex = e;
  				}
  			}
  			loader = (c == null && checkParents) ? loader.getParent() : null;
  		}
  
  		if (c == null) {
  			try {
  				c = Class.forName(name);
  			} catch (ClassNotFoundException e) {
  				if (ex == null) {
  					ex = e;
  				}
  			}
  		}
  
  		if (c != null) {
  			return c;
  		}
  		throw ex;
  	}
docs: Load a class.
  
  @param loadClass
  @param name
  @param checkParents If true, try loading directly from parent classloaders.
  @return Class
  @throws ClassNotFoundException