public static Class forName ( Class clazz , ClassLoader classLoader ) throws ClassNotFoundException , LinkageError { if ( clazz == null ) return null ; if ( classLoader == null ) { classLoader = getDefaultClassLoader ( ) ; } if ( clazz . getClassLoader ( ) == null || clazz . getClassLoader ( ) . equals ( classLoader ) ) return clazz ; else return forName ( clazz . getName ( ) , classLoader ) ; }
Convenient call to return a class in a different class loader ... note that it will handle correctly a class in the same class loader