src/java.base/share/classes/jdk/internal/module/ModulePath.java
Print this page
*** 64,75 ****
import java.util.zip.ZipFile;
import jdk.internal.jmod.JmodFile;
import jdk.internal.jmod.JmodFile.Section;
import jdk.internal.perf.PerfCounter;
- import jdk.internal.util.jar.VersionedStream;
-
/**
* A {@code ModuleFinder} that locates modules on the file system by searching
* a sequence of directories or packaged modules. The ModuleFinder can be
* created to work in either the run-time or link-time phases. In both cases it
--- 64,73 ----
*** 513,523 ****
// module version if present
if (vs != null)
builder.version(vs);
// scan the names of the entries in the JAR file
! Map<Boolean, Set<String>> map = VersionedStream.stream(jf)
.filter(e -> !e.isDirectory())
.map(JarEntry::getName)
.filter(e -> (e.endsWith(".class") ^ e.startsWith(SERVICES_PREFIX)))
.collect(Collectors.partitioningBy(e -> e.startsWith(SERVICES_PREFIX),
Collectors.toSet()));
--- 511,521 ----
// module version if present
if (vs != null)
builder.version(vs);
// scan the names of the entries in the JAR file
! Map<Boolean, Set<String>> map = jf.versionedStream()
.filter(e -> !e.isDirectory())
.map(JarEntry::getName)
.filter(e -> (e.endsWith(".class") ^ e.startsWith(SERVICES_PREFIX)))
.collect(Collectors.partitioningBy(e -> e.startsWith(SERVICES_PREFIX),
Collectors.toSet()));
*** 613,623 ****
return mn;
}
private Set<String> jarPackages(JarFile jf) {
! return VersionedStream.stream(jf)
.filter(e -> !e.isDirectory())
.map(JarEntry::getName)
.map(this::toPackageName)
.flatMap(Optional::stream)
.collect(Collectors.toSet());
--- 611,621 ----
return mn;
}
private Set<String> jarPackages(JarFile jf) {
! return jf.versionedStream()
.filter(e -> !e.isDirectory())
.map(JarEntry::getName)
.map(this::toPackageName)
.flatMap(Optional::stream)
.collect(Collectors.toSet());