diff --git a/sootup.java.bytecode.frontend/src/main/java/sootup/java/bytecode/frontend/inputlocation/JrtFileSystemAnalysisInputLocation.java b/sootup.java.bytecode.frontend/src/main/java/sootup/java/bytecode/frontend/inputlocation/JrtFileSystemAnalysisInputLocation.java index a5019d5ce3..25a0d46686 100644 --- a/sootup.java.bytecode.frontend/src/main/java/sootup/java/bytecode/frontend/inputlocation/JrtFileSystemAnalysisInputLocation.java +++ b/sootup.java.bytecode.frontend/src/main/java/sootup/java/bytecode/frontend/inputlocation/JrtFileSystemAnalysisInputLocation.java @@ -83,7 +83,7 @@ public Optional getClassSource( @Nonnull ClassType classType, @Nonnull View view) { JavaClassType klassType = (JavaClassType) classType; - ClassProvider classProvider = new AsmJavaClassProvider(view); + ClassProvider classProvider = getClassProvider(view); Path filepath = theFileSystem.getPath( klassType.getFullyQualifiedName().replace('.', '/') @@ -143,7 +143,7 @@ protected Stream getClassSourcesInternal( @Nonnull IdentifierFactory identifierFactory, @Nonnull View view) { - ClassProvider classProvider = new AsmJavaClassProvider(view); + ClassProvider classProvider = getClassProvider(view); String moduleInfoFilename = JavaModuleIdentifierFactory.MODULE_INFO_FILE @@ -156,12 +156,15 @@ protected Stream getClassSourcesInternal( List javaSootClassSources = paths .filter( - filePath -> - !Files.isDirectory(filePath) - && filePath - .toString() - .endsWith(classProvider.getHandledFileType().getExtensionWithDot()) - && !filePath.toString().endsWith(moduleInfoFilename)) + filePath -> { + if (!Files.isDirectory(filePath)) { + String pathStr = filePath.toString(); + return pathStr.endsWith( + classProvider.getHandledFileType().getExtensionWithDot()) + && !pathStr.endsWith(moduleInfoFilename); + } + return false; + }) .flatMap( p -> StreamUtils.optionalToStream( @@ -174,6 +177,10 @@ protected Stream getClassSourcesInternal( } } + protected ClassProvider getClassProvider(@Nonnull View view) { + return new AsmJavaClassProvider(view); + } + @Override public @Nonnull Collection getClassSources(@Nonnull View view) {