private static void handleRealModule ( final Object module , final Set < Object > visitedModules , final ClassLoader classLoader , final ClasspathOrder classpathOrderOut , final ScanSpec scanSpec , final LogNode log ) { if ( ! visitedModules . add ( module ) ) { // Avoid extracting paths from the same module more than once return ; } ClassLoader moduleLoader = ( ClassLoader ) ReflectionUtils . invokeMethod ( module , "getClassLoader" , false ) ; if ( moduleLoader == null ) { moduleLoader = classLoader ; } // type VFSResourceLoader[] final Object vfsResourceLoaders = ReflectionUtils . invokeMethod ( moduleLoader , "getResourceLoaders" , false ) ; if ( vfsResourceLoaders != null ) { for ( int i = 0 , n = Array . getLength ( vfsResourceLoaders ) ; i < n ; i ++ ) { // type JarFileResourceLoader for jars, VFSResourceLoader for exploded jars, PathResourceLoader // for resource directories, or NativeLibraryResourceLoader for (usually non-existent) native // library "lib/" dirs adjacent to the jarfiles that they were presumably extracted from. final Object resourceLoader = Array . get ( vfsResourceLoaders , i ) ; // Could skip NativeLibraryResourceLoader instances altogether, but testing for their existence // only seems to add about 3% to the total scan time. // if (!resourceLoader.getClass().getSimpleName().equals("NativeLibraryResourceLoader")) { handleResourceLoader ( resourceLoader , moduleLoader , classpathOrderOut , scanSpec , log ) ; //} } } }
Handle a module .