public static void popPreferredClassLoader ( ) { final ClassLoader sysLoader = ClassLoaderFinder . class . getClassLoader ( ) ; if ( ( dynamicLoader == null ) || ( dynamicLoader == sysLoader ) ) { dynamicLoader = null ; final Thread [ ] threads = new Thread [ Thread . activeCount ( ) ] ; Thread . enumerate ( threads ) ; for ( final Thread t : threads ) { if ( t != null ) { t . setContextClassLoader ( sysLoader ) ; } } return ; } final ClassLoader parent = dynamicLoader . getParent ( ) ; dynamicLoader = ( parent == sysLoader ) ? null : parent ; final Thread [ ] threads = new Thread [ Thread . activeCount ( ) ] ; Thread . enumerate ( threads ) ; for ( final Thread t : threads ) { if ( t != null ) { t . setContextClassLoader ( parent ) ; } } }
Pop the preferred class loader .