public static ClassLoader getClassLoaderOfClass(final Class<?> clazz) {
    ClassLoader cl = clazz.getClassLoader();
    if (cl == null) {
      return ClassLoader.getSystemClassLoader();
    } else {
      return cl;
    }
  }
public static ClassLoader getClassLoaderOfClass ( final Class < ? > clazz ) { ClassLoader cl = clazz . getClassLoader ( ) ; if ( cl == null ) { return ClassLoader . getSystemClassLoader ( ) ; } else { return cl ; } }
Return the class loader which loaded the class passed as argument. Return
the system class loader if appropriate.

@param clazz the class to evaluate
@return the classloader of the object