On Thu, 20 Jun 2024 17:25:33 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> Something like that yes
>
> An altermative is to use ResolvedModule::reference to get a ModuleReference, 
> then use its open method to open the contents of the module to get a 
> ModuleReader. That will give you a stream over the names of all resources in 
> the module. It will work for all exploded and packaged modules.

I took a look at this. I had to refactor a bit and introduce an intermediate 
abstraction (`ClassFileSource`) to abstract over classes loaded from a 
`JarFile` (for the class path) and a `ModuleReader` (for module path). At that 
point, it was also easy to add a third option for directories of class files on 
that class path, so I've done that as well.

See: 
https://github.com/openjdk/jdk/pull/19774/commits/a046f6fe9465feda63609dd50014338ca218923f

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19774#discussion_r1649434411

Reply via email to