/** Close the classpath elements. */ @Override public void close() throws Exception { for (final ClasspathElement classpathElt : values()) { classpathElt.close(); } } }
/** * Returns the list of unique classpath element paths as URLs, in classloader resolution order. * * @return The unique classpath element URLs. */ public List<URL> getUniqueClasspathElementURLs() { final List<URL> classpathElementOrderURLs = new ArrayList<>(); for (final ClasspathElement classpathElement : classpathOrder) { final ModuleRef modRef = classpathElement.getClasspathElementModuleRef(); if (modRef != null) { // Add module URLs whether or not they have a "jrt:/" scheme try { classpathElementOrderURLs.add(modRef.getModuleLocation().toURL()); } catch (final MalformedURLException e) { // Skip malformed URLs (shouldn't happen) } } else { try { classpathElementOrderURLs.add(classpathElement.getClasspathElementFile(log).toURI().toURL()); } catch (final MalformedURLException e) { // Shouldn't happen } } } return classpathElementOrderURLs; }
/** Create a new classpath element singleton instance. */ @Override public ClasspathElement newInstance(final RelativePath classpathElt, final LogNode log) { return ClasspathElement.newInstance(classpathElt, scanFiles, scanSpec, nestedJarHandler, workQueue, interruptionChecker, log); }
for (int i = 0; i < classpathOrder.size(); i++) { final ClasspathElement classpathElt = classpathOrder.get(i); final String packageRoot = classpathElt.getJarfilePackageRoot(); final ModuleRef classpathElementModuleRef = classpathElt.getClasspathElementModuleRef(); if (classpathElementModuleRef != null) { logNode.log(i + ": module " + classpathElementModuleRef.getModuleName() + " ; module location: " + classpathElementModuleRef.getModuleLocationStr()); } else { final String classpathEltStr = classpathElt.toString(); final String classpathEltFileStr = "" + classpathElt.getClasspathElementFile(logNode); logNode.log(i + ": " + (classpathEltStr.equals(classpathEltFileStr) && packageRoot.isEmpty() ? classpathEltStr for (int classpathIdx = 0; classpathIdx < classpathOrder.size(); classpathIdx++) { final ClasspathElement classpathElement = classpathOrder.get(classpathIdx); classpathElement.maskFiles(classpathIdx, classpathRelativePathsFound, maskLog); final ModuleRef modRef = classpathElement.getClasspathElementModuleRef(); if (modRef == null) { final File classpathEltFile = classpathElement.classpathEltPath
final ModuleRef modRef = classpathElement.getClasspathElementModuleRef(); final File file = modRef != null ? null : classpathElement.getClasspathElementFile(log); if ((classInfo.classpathElementModuleRef != null && modRef != null && !classInfo.classpathElementModuleRef.equals(modRef)) classInfo.jarfilePackageRoot = classpathElement.getJarfilePackageRoot(); final ClassLoader[] classLoaders = classpathElement.getClassLoaders(); if (classInfo.classLoaders == null) { classInfo.classLoaders = classLoaders;
@Override public void processWorkUnit(final ClassfileParserChunk chunk) throws Exception { ClassfileBinaryParser classfileBinaryParser = null; try { classfileBinaryParser = classfileBinaryParserRecycler.acquire(); chunk.classpathElement.parseClassfiles(classfileBinaryParser, chunk.classfileStartIdx, chunk.classfileEndIdx, classInfoUnlinked, classfileScanLog); } finally { classfileBinaryParserRecycler.release(classfileBinaryParser); classfileBinaryParser = null; } } }, interruptionChecker, classfileScanLog);
for (final ClasspathElement classpathElement : classpathOrder) { final LinkedList<ClassfileParserChunk> chunksForClasspathElt = new LinkedList<>(); final int numClassfileMatches = classpathElement.getNumClassfileMatches(); if (numClassfileMatches > 0) { final int numChunks = (int) Math.ceil((float) numClassfileMatches / (float) NUM_FILES_PER_CHUNK);
classpathElement.callFileMatchProcessors(scanResult, log);
/** * Returns the list of File objects for unique classpath elements (directories or jarfiles), in classloader * resolution order. * * @return The unique classpath elements. */ public List<File> getUniqueClasspathElements() { final List<File> classpathElementOrderFiles = new ArrayList<>(); for (final ClasspathElement classpathElement : classpathOrder) { final ModuleRef modRef = classpathElement.getClasspathElementModuleRef(); if (modRef != null) { if (!modRef.isSystemModule()) { // Add module files when they don't have a "jrt:/" scheme final File moduleLocationFile = modRef.getModuleLocationFile(); if (moduleLocationFile != null) { classpathElementOrderFiles.add(moduleLocationFile); } } } else { classpathElementOrderFiles.add(classpathElement.getClasspathElementFile(log)); } } return classpathElementOrderFiles; }