Skip to content

Commit

Permalink
Ignore JrtFileSystem (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehutch committed Sep 9, 2021
1 parent 9745946 commit 6ca4484
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/io/github/classgraph/Scanner.java
Expand Up @@ -482,6 +482,13 @@ public ClasspathElement newInstance(final ClasspathElementAndClassLoader classpa
return new ClasspathElementZip(classpathEntryPath, classpathEntry.classLoader,
nestedJarHandler, scanSpec);
} else if (FileUtils.canReadAndIsDir(packageRootPath)) {
if ("JrtFileSystem"
.equals(packageRootPath.getFileSystem().getClass().getSimpleName())) {
// Ignore JrtFileSystem (#553) -- paths are of form:
// /modules/java.base/module-info.class
throw new IOException("Ignoring JrtFS filesystem path " + packageRootPath
+ " (modules are scanned using the JPMS API)");
}
// classpathEntryObj is a Path which points to a dir -- need to scan it recursively
return new ClasspathElementPathDir(classpathEntryPath, dirOrPathPackageRoot,
classpathEntry.classLoader, nestedJarHandler, scanSpec);
Expand Down

0 comments on commit 6ca4484

Please sign in to comment.