private static boolean isLoadable ( Class < ? > clazz , ClassLoader classLoader ) { try { return ( clazz == classLoader . loadClass ( clazz . getName ( ) ) ) ; // Else: different class with same name found } catch ( ClassNotFoundException ex ) { // No corresponding class found at all return false ; } }
Check whether the given class is loadable in the given ClassLoader .