RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v8]

Jorn Vernee jvernee at openjdk.org
Fri Jun 21 21:17:46 UTC 2024


On Thu, 20 Jun 2024 17:25:33 GMT, Alan Bateman <alanb at 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


More information about the build-dev mailing list